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

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

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

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

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

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

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

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

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

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

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

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

_ZNK5draco17AttributesDecoder14GetAttributeIdEi:
   44|   122k|  int32_t GetAttributeId(int i) const override {
   45|   122k|    return point_attribute_ids_[i];
   46|   122k|  }
_ZNK5draco17AttributesDecoder16GetNumAttributesEv:
   47|  79.1k|  int32_t GetNumAttributes() const override {
   48|  79.1k|    return static_cast<int32_t>(point_attribute_ids_.size());
   49|  79.1k|  }
_ZNK5draco17AttributesDecoder10GetDecoderEv:
   50|  68.8k|  PointCloudDecoder* GetDecoder() const override {
   51|  68.8k|    return point_cloud_decoder_;
   52|  68.8k|  }
_ZN5draco17AttributesDecoder16DecodeAttributesEPNS_13DecoderBufferE:
   55|  9.60k|  bool DecodeAttributes(DecoderBuffer* in_buffer) override {
   56|  9.60k|    if (!DecodePortableAttributes(in_buffer)) {
  ------------------
  |  Branch (56:9): [True: 4.09k, False: 5.50k]
  ------------------
   57|  4.09k|      return false;
   58|  4.09k|    }
   59|  5.50k|    if (!DecodeDataNeededByPortableTransforms(in_buffer)) {
  ------------------
  |  Branch (59:9): [True: 2.26k, False: 3.24k]
  ------------------
   60|  2.26k|      return false;
   61|  2.26k|    }
   62|  3.24k|    if (!TransformAttributesToOriginalFormat()) {
  ------------------
  |  Branch (62:9): [True: 535, False: 2.70k]
  ------------------
   63|    535|      return false;
   64|    535|    }
   65|  2.70k|    return true;
   66|  3.24k|  }
_ZNK5draco17AttributesDecoder27GetLocalIdForPointAttributeEi:
   69|  3.17k|  int32_t GetLocalIdForPointAttribute(int32_t point_attribute_id) const {
   70|  3.17k|    const int id_map_size =
   71|  3.17k|        static_cast<int>(point_attribute_to_local_id_map_.size());
   72|  3.17k|    if (point_attribute_id >= id_map_size) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.17k]
  ------------------
   73|      0|      return -1;
   74|      0|    }
   75|  3.17k|    return point_attribute_to_local_id_map_[point_attribute_id];
   76|  3.17k|  }
_ZN5draco17AttributesDecoderD2Ev:
   35|  55.7k|  virtual ~AttributesDecoder() = default;

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  3.54k|      : quantization_bits_(-1),
   54|  3.54k|        max_quantized_value_(-1),
   55|  3.54k|        max_value_(-1),
   56|  3.54k|        dequantization_scale_(1.f),
   57|  3.54k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  3.26k|  bool SetQuantizationBits(int32_t q) {
   60|  3.26k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 1.27k, False: 1.99k]
  |  Branch (60:18): [True: 212, False: 1.78k]
  ------------------
   61|  1.48k|      return false;
   62|  1.48k|    }
   63|  1.78k|    quantization_bits_ = q;
   64|  1.78k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.78k|    max_value_ = max_quantized_value_ - 1;
   66|  1.78k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.78k|    center_value_ = max_value_ / 2;
   68|  1.78k|    return true;
   69|  3.26k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  4.06M|                                           int32_t* out_t) const {
   77|  4.06M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 4.75k, False: 4.05M]
  |  Branch (77:20): [True: 0, False: 4.75k]
  |  Branch (77:32): [True: 4.75k, False: 4.05M]
  |  Branch (77:42): [True: 0, False: 4.75k]
  ------------------
   78|  4.06M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 3.68M, False: 376k]
  |  Branch (78:29): [True: 14.2k, False: 3.67M]
  ------------------
   79|  14.2k|      s = max_value_;
   80|  14.2k|      t = max_value_;
   81|  4.04M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 4.75k, False: 4.04M]
  |  Branch (81:26): [True: 2.21k, False: 2.54k]
  ------------------
   82|  2.21k|      t = center_value_ - (t - center_value_);
   83|  4.04M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 3.67M, False: 373k]
  |  Branch (83:35): [True: 11.9k, False: 3.66M]
  ------------------
   84|  11.9k|      t = center_value_ + (center_value_ - t);
   85|  4.03M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 3.66M, False: 371k]
  |  Branch (85:35): [True: 1.67k, False: 3.66M]
  ------------------
   86|  1.67k|      s = center_value_ + (center_value_ - s);
   87|  4.03M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.74k, False: 4.02M]
  |  Branch (87:26): [True: 2.18k, False: 2.55k]
  ------------------
   88|  2.18k|      s = center_value_ - (s - center_value_);
   89|  2.18k|    }
   90|       |
   91|  4.06M|    *out_s = s;
   92|  4.06M|    *out_t = t;
   93|  4.06M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  4.06M|                                                       int32_t* out_t) const {
  100|  4.06M|    DRACO_DCHECK_EQ(
  101|  4.06M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  4.06M|        center_value_);
  103|  4.06M|    int32_t s, t;
  104|  4.06M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 2.31M, False: 1.74M]
  ------------------
  105|       |      // Right hemisphere.
  106|  2.31M|      s = (int_vec[1] + center_value_);
  107|  2.31M|      t = (int_vec[2] + center_value_);
  108|  2.31M|    } else {
  109|       |      // Left hemisphere.
  110|  1.74M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 41.3k, False: 1.70M]
  ------------------
  111|  41.3k|        s = std::abs(int_vec[2]);
  112|  1.70M|      } else {
  113|  1.70M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.70M|      }
  115|  1.74M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 47.1k, False: 1.70M]
  ------------------
  116|  47.1k|        t = std::abs(int_vec[1]);
  117|  1.70M|      } else {
  118|  1.70M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.70M|      }
  120|  1.74M|    }
  121|  4.06M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  4.06M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  67.3M|                                                    float* out_vector) const {
  199|  67.3M|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  67.3M|                                 in_t * dequantization_scale_ - 1.f,
  201|  67.3M|                                 out_vector);
  202|  67.3M|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|   187M|  inline bool IsInDiamond(const int32_t& s, const int32_t& t) const {
  206|       |    // Expect center already at origin.
  207|   187M|    DRACO_DCHECK_LE(s, center_value_);
  208|   187M|    DRACO_DCHECK_LE(t, center_value_);
  209|   187M|    DRACO_DCHECK_GE(s, -center_value_);
  210|   187M|    DRACO_DCHECK_GE(t, -center_value_);
  211|   187M|    const uint32_t st =
  212|   187M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|   187M|    return st <= center_value_;
  214|   187M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|   375M|  void InvertDiamond(int32_t* s, int32_t* t) const {
  217|       |    // Expect center already at origin.
  218|   375M|    DRACO_DCHECK_LE(*s, center_value_);
  219|   375M|    DRACO_DCHECK_LE(*t, center_value_);
  220|   375M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|   375M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|   375M|    int32_t sign_s = 0;
  223|   375M|    int32_t sign_t = 0;
  224|   375M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 374M, False: 288k]
  |  Branch (224:20): [True: 374M, False: 103k]
  ------------------
  225|   374M|      sign_s = 1;
  226|   374M|      sign_t = 1;
  227|   374M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 291k, False: 100k]
  |  Branch (227:27): [True: 137k, False: 153k]
  ------------------
  228|   137k|      sign_s = -1;
  229|   137k|      sign_t = -1;
  230|   253k|    } else {
  231|   253k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 100k, False: 153k]
  ------------------
  232|   253k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 153k, False: 100k]
  ------------------
  233|   253k|    }
  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|   375M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|   375M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|   375M|    uint32_t us = *s;
  241|   375M|    uint32_t ut = *t;
  242|   375M|    us = us + us - corner_point_s;
  243|   375M|    ut = ut + ut - corner_point_t;
  244|   375M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 374M, False: 253k]
  ------------------
  245|   374M|      uint32_t temp = us;
  246|   374M|      us = -ut;
  247|   374M|      ut = -temp;
  248|   374M|    } else {
  249|   253k|      std::swap(us, ut);
  250|   253k|    }
  251|   375M|    us = us + corner_point_s;
  252|   375M|    ut = ut + corner_point_t;
  253|       |
  254|   375M|    *s = us;
  255|   375M|    *t = ut;
  256|   375M|    *s /= 2;
  257|   375M|    *t /= 2;
  258|   375M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|   375M|  int32_t ModMax(int32_t x) const {
  273|   375M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 5.25k, False: 375M]
  ------------------
  274|  5.25k|      return x - this->max_quantized_value();
  275|  5.25k|    }
  276|   375M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.30k, False: 375M]
  ------------------
  277|  2.30k|      return x + this->max_quantized_value();
  278|  2.30k|    }
  279|   375M|    return x;
  280|   375M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.72k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  7.56k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  1.12G|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  67.3M|                                           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|  67.3M|    float y = in_s_scaled;
  329|  67.3M|    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|  67.3M|    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|  67.3M|    float x_offset = -x;
  342|  67.3M|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 24, False: 67.3M]
  ------------------
  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|  67.3M|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 53.5k, False: 67.3M]
  ------------------
  348|  67.3M|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 777, False: 67.3M]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  67.3M|    const float norm_squared = x * x + y * y + z * z;
  352|  67.3M|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 67.3M]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  67.3M|    } else {
  357|  67.3M|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  67.3M|      out_vector[0] = x * d;
  359|  67.3M|      out_vector[1] = y * d;
  360|  67.3M|      out_vector[2] = z * d;
  361|  67.3M|    }
  362|  67.3M|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  4.06M|  void CanonicalizeIntegerVector(T* vec) const {
  174|  4.06M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  4.06M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  4.06M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  4.06M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  4.06M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  4.06M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 3.81M, False: 247k]
  ------------------
  181|  3.81M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  3.81M|    } else {
  183|   247k|      vec[0] =
  184|   247k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   247k|          abs_sum;
  186|   247k|      vec[1] =
  187|   247k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   247k|          abs_sum;
  189|   247k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 137k, False: 110k]
  ------------------
  190|   137k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   137k|      } else {
  192|   110k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   110k|      }
  194|   247k|    }
  195|  4.06M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    576|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    576|            attribute, transform, mesh_data),
   52|    576|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    562|                                                                buffer) {
  197|    562|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    562|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    562|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 2, False: 560]
  ------------------
  199|       |    // Decode prediction mode.
  200|      2|    uint8_t mode;
  201|      2|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 0, False: 2]
  ------------------
  202|      0|      return false;
  203|      0|    }
  204|       |
  205|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 1, False: 1]
  ------------------
  206|       |      // Unsupported mode.
  207|      1|      return false;
  208|      1|    }
  209|      2|  }
  210|    561|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  2.58k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 2.11k, False: 468]
  ------------------
  214|  2.11k|    uint32_t num_flags;
  215|  2.11k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 17, False: 2.09k]
  ------------------
  216|     17|      return false;
  217|     17|    }
  218|  2.09k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 41, False: 2.05k]
  ------------------
  219|     41|      return false;
  220|     41|    }
  221|  2.05k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 725, False: 1.33k]
  ------------------
  222|    725|      is_crease_edge_[i].resize(num_flags);
  223|    725|      RAnsBitDecoder decoder;
  224|    725|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 35, False: 690]
  ------------------
  225|     35|        return false;
  226|     35|      }
  227|  1.58M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.58M, False: 690]
  ------------------
  228|  1.58M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.58M|      }
  230|    690|      decoder.EndDecoding();
  231|    690|    }
  232|  2.05k|  }
  233|    468|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    468|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    561|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    421|                          const PointIndex* /* entry_to_point_id_map */) {
   87|    421|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    421|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  2.10k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.68k, False: 421]
  ------------------
   93|  1.68k|    pred_vals[i].resize(num_components, 0);
   94|  1.68k|  }
   95|    421|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    421|                                         out_data);
   97|       |
   98|    421|  const CornerTable* const table = this->mesh_data().corner_table();
   99|    421|  const std::vector<int32_t>* const vertex_to_data_map =
  100|    421|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    421|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    421|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    421|  const int corner_map_size =
  109|    421|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    421|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 421]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|  1.13M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 1.13M, False: 258]
  ------------------
  114|  1.13M|    const CornerIndex start_corner_id =
  115|  1.13M|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|  1.13M|    CornerIndex corner_id(start_corner_id);
  118|  1.13M|    int num_parallelograms = 0;
  119|  1.13M|    bool first_pass = true;
  120|  2.37M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 1.27M, False: 1.10M]
  ------------------
  121|  1.27M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 55.6k, False: 1.21M]
  ------------------
  122|  1.27M|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|  1.27M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|  55.6k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|  55.6k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 607, False: 55.0k]
  ------------------
  130|    607|          break;
  131|    607|        }
  132|  55.6k|      }
  133|       |
  134|       |      // Proceed to the next corner attached to the vertex. First swing left
  135|       |      // and if we reach a boundary, swing right from the start corner.
  136|  1.27M|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 1.26M, False: 7.97k]
  ------------------
  137|  1.26M|        corner_id = table->SwingLeft(corner_id);
  138|  1.26M|      } else {
  139|  7.97k|        corner_id = table->SwingRight(corner_id);
  140|  7.97k|      }
  141|  1.27M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 24.6k, False: 1.24M]
  ------------------
  142|  24.6k|        break;
  143|  24.6k|      }
  144|  1.24M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 1.11M, False: 135k]
  |  Branch (144:47): [True: 1.10M, False: 3.85k]
  ------------------
  145|  1.10M|        first_pass = false;
  146|  1.10M|        corner_id = table->SwingRight(start_corner_id);
  147|  1.10M|      }
  148|  1.24M|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|  1.13M|    int num_used_parallelograms = 0;
  153|  1.13M|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 30.5k, False: 1.10M]
  ------------------
  154|  2.15M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 2.12M, False: 30.5k]
  ------------------
  155|  2.12M|        multi_pred_vals[i] = 0;
  156|  2.12M|      }
  157|       |      // Check which parallelograms are actually used.
  158|  85.9k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 55.6k, False: 30.3k]
  ------------------
  159|  55.6k|        const int context = num_parallelograms - 1;
  160|  55.6k|        const int pos = is_crease_edge_pos[context]++;
  161|  55.6k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 163, False: 55.4k]
  ------------------
  162|    163|          return false;
  163|    163|        }
  164|  55.4k|        const bool is_crease = is_crease_edge_[context][pos];
  165|  55.4k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 15.0k, False: 40.4k]
  ------------------
  166|  15.0k|          ++num_used_parallelograms;
  167|  1.08M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 1.06M, False: 15.0k]
  ------------------
  168|  1.06M|            multi_pred_vals[j] =
  169|  1.06M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  1.06M|          }
  171|  15.0k|        }
  172|  55.4k|      }
  173|  30.5k|    }
  174|  1.13M|    const int dst_offset = p * num_components;
  175|  1.13M|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 1.12M, False: 6.10k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|  1.12M|      const int src_offset = (p - 1) * num_components;
  179|  1.12M|      this->transform().ComputeOriginalValue(
  180|  1.12M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|  1.12M|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|   466k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 460k, False: 6.10k]
  ------------------
  184|   460k|        multi_pred_vals[c] /= num_used_parallelograms;
  185|   460k|      }
  186|  6.10k|      this->transform().ComputeOriginalValue(
  187|  6.10k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  6.10k|    }
  189|  1.13M|  }
  190|    258|  return true;
  191|    421|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    751|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    751|            attribute, transform, mesh_data),
   52|    751|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    735|                                                                buffer) {
  197|    735|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    735|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    735|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 11, False: 724]
  ------------------
  199|       |    // Decode prediction mode.
  200|     11|    uint8_t mode;
  201|     11|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 0, False: 11]
  ------------------
  202|      0|      return false;
  203|      0|    }
  204|       |
  205|     11|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 1, False: 10]
  ------------------
  206|       |      // Unsupported mode.
  207|      1|      return false;
  208|      1|    }
  209|     11|  }
  210|    734|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  3.23k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 2.67k, False: 563]
  ------------------
  214|  2.67k|    uint32_t num_flags;
  215|  2.67k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 26, False: 2.65k]
  ------------------
  216|     26|      return false;
  217|     26|    }
  218|  2.65k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 85, False: 2.56k]
  ------------------
  219|     85|      return false;
  220|     85|    }
  221|  2.56k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 1.01k, False: 1.55k]
  ------------------
  222|  1.01k|      is_crease_edge_[i].resize(num_flags);
  223|  1.01k|      RAnsBitDecoder decoder;
  224|  1.01k|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 60, False: 955]
  ------------------
  225|     60|        return false;
  226|     60|      }
  227|  2.16M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 2.15M, False: 955]
  ------------------
  228|  2.15M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  2.15M|      }
  230|    955|      decoder.EndDecoding();
  231|    955|    }
  232|  2.56k|  }
  233|    563|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    563|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    734|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    522|                          const PointIndex* /* entry_to_point_id_map */) {
   87|    522|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    522|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  2.61k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 2.08k, False: 522]
  ------------------
   93|  2.08k|    pred_vals[i].resize(num_components, 0);
   94|  2.08k|  }
   95|    522|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    522|                                         out_data);
   97|       |
   98|    522|  const CornerTable* const table = this->mesh_data().corner_table();
   99|    522|  const std::vector<int32_t>* const vertex_to_data_map =
  100|    522|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    522|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    522|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    522|  const int corner_map_size =
  109|    522|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    522|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 522]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   220k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 219k, False: 253]
  ------------------
  114|   219k|    const CornerIndex start_corner_id =
  115|   219k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   219k|    CornerIndex corner_id(start_corner_id);
  118|   219k|    int num_parallelograms = 0;
  119|   219k|    bool first_pass = true;
  120|  1.29M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 1.28M, False: 8.91k]
  ------------------
  121|  1.28M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 417k, False: 863k]
  ------------------
  122|  1.28M|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|  1.28M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|   417k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|   417k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 604, False: 417k]
  ------------------
  130|    604|          break;
  131|    604|        }
  132|   417k|      }
  133|       |
  134|       |      // Proceed to the next corner attached to the vertex. First swing left
  135|       |      // and if we reach a boundary, swing right from the start corner.
  136|  1.28M|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 1.27M, False: 8.11k]
  ------------------
  137|  1.27M|        corner_id = table->SwingLeft(corner_id);
  138|  1.27M|      } else {
  139|  8.11k|        corner_id = table->SwingRight(corner_id);
  140|  8.11k|      }
  141|  1.28M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 210k, False: 1.07M]
  ------------------
  142|   210k|        break;
  143|   210k|      }
  144|  1.07M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 12.8k, False: 1.05M]
  |  Branch (144:47): [True: 8.92k, False: 3.96k]
  ------------------
  145|  8.92k|        first_pass = false;
  146|  8.92k|        corner_id = table->SwingRight(start_corner_id);
  147|  8.92k|      }
  148|  1.07M|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   219k|    int num_used_parallelograms = 0;
  153|   219k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 213k, False: 6.01k]
  ------------------
  154|  8.57M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 8.36M, False: 213k]
  ------------------
  155|  8.36M|        multi_pred_vals[i] = 0;
  156|  8.36M|      }
  157|       |      // Check which parallelograms are actually used.
  158|   631k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 417k, False: 213k]
  ------------------
  159|   417k|        const int context = num_parallelograms - 1;
  160|   417k|        const int pos = is_crease_edge_pos[context]++;
  161|   417k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 269, False: 417k]
  ------------------
  162|    269|          return false;
  163|    269|        }
  164|   417k|        const bool is_crease = is_crease_edge_[context][pos];
  165|   417k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 56.8k, False: 360k]
  ------------------
  166|  56.8k|          ++num_used_parallelograms;
  167|  2.17M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 2.11M, False: 56.8k]
  ------------------
  168|  2.11M|            multi_pred_vals[j] =
  169|  2.11M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  2.11M|          }
  171|  56.8k|        }
  172|   417k|      }
  173|   213k|    }
  174|   219k|    const int dst_offset = p * num_components;
  175|   219k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 191k, False: 27.7k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|   191k|      const int src_offset = (p - 1) * num_components;
  179|   191k|      this->transform().ComputeOriginalValue(
  180|   191k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|   191k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|  1.12M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 1.09M, False: 27.7k]
  ------------------
  184|  1.09M|        multi_pred_vals[c] /= num_used_parallelograms;
  185|  1.09M|      }
  186|  27.7k|      this->transform().ComputeOriginalValue(
  187|  27.7k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  27.7k|    }
  189|   219k|  }
  190|    253|  return true;
  191|    522|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  3.43k|           const std::vector<int32_t>* vertex_to_data_map) {
   38|  3.43k|    mesh_ = mesh;
   39|  3.43k|    corner_table_ = table;
   40|  3.43k|    data_to_corner_map_ = data_to_corner_map;
   41|  3.43k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  3.43k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  22.7M|  const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  15.3M|  const std::vector<int32_t>* vertex_to_data_map() const {
   47|  15.3M|    return vertex_to_data_map_;
   48|  15.3M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  9.81M|  const std::vector<CornerIndex>* data_to_corner_map() const {
   50|  9.81M|    return data_to_corner_map_;
   51|  9.81M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  3.90k|           const std::vector<int32_t>* vertex_to_data_map) {
   38|  3.90k|    mesh_ = mesh;
   39|  3.90k|    corner_table_ = table;
   40|  3.90k|    data_to_corner_map_ = data_to_corner_map;
   41|  3.90k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  3.90k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  11.2M|  const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  9.42M|  const std::vector<int32_t>* vertex_to_data_map() const {
   47|  9.42M|    return vertex_to_data_map_;
   48|  9.42M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  3.02M|  const std::vector<CornerIndex>* data_to_corner_map() const {
   50|  3.02M|    return data_to_corner_map_;
   51|  3.02M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  3.43k|      : mesh_(nullptr),
   31|  3.43k|        corner_table_(nullptr),
   32|  3.43k|        vertex_to_data_map_(nullptr),
   33|  3.43k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  3.90k|      : mesh_(nullptr),
   31|  3.90k|        corner_table_(nullptr),
   32|  3.90k|        vertex_to_data_map_(nullptr),
   33|  3.90k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  1.04M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   237k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   396k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   182k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  3.05k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  3.05k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  14.1M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  3.53k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  3.53k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  4.37M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    157|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    157|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    197|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    197|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    193|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    193|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    161|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    161|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    313|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    157|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    157|    DRACO_DCHECK_EQ(i, 0);
   70|    157|    (void)i;
   71|    157|    return GeometryAttribute::POSITION;
   72|    157|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    157|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    157|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 157]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    157|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 156]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    156|    predictor_.SetPositionAttribute(*att);
   82|    156|    return true;
   83|    157|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    155|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    155|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 7, False: 148]
  ------------------
  148|      7|    return false;
  149|      7|  }
  150|       |
  151|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    148|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 32, False: 116]
  ------------------
  153|     32|    uint8_t prediction_mode;
  154|     32|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 32]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     32|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 30]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     30|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 30]
  ------------------
  163|     30|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     30|  }
  167|    146|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    146|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 10, False: 136]
  ------------------
  171|     10|    return false;
  172|     10|  }
  173|       |
  174|    136|  return true;
  175|    146|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    136|                                      const PointIndex* entry_to_point_id_map) {
  103|    136|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    136|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    136|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    136|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    136|  const int corner_map_size =
  111|    136|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    136|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 136]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    136|  VectorD<int32_t, 3> pred_normal_3d;
  117|    136|  int32_t pred_normal_oct[2];
  118|       |
  119|  1.04M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 1.04M, False: 136]
  ------------------
  120|  1.04M|    const CornerIndex corner_id =
  121|  1.04M|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|  1.04M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|  1.04M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|  1.04M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|  1.04M|                    octahedron_tool_box_.center_value());
  128|  1.04M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 933k, False: 106k]
  ------------------
  129|   933k|      pred_normal_3d = -pred_normal_3d;
  130|   933k|    }
  131|  1.04M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|  1.04M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|  1.04M|    const int data_offset = data_id * 2;
  135|  1.04M|    this->transform().ComputeOriginalValue(
  136|  1.04M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|  1.04M|  }
  138|    136|  flip_normal_bit_decoder_.EndDecoding();
  139|    136|  return true;
  140|    136|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    136|  void SetQuantizationBits(int q) {
   85|    136|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    136|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    391|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    197|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    197|    DRACO_DCHECK_EQ(i, 0);
   70|    197|    (void)i;
   71|    197|    return GeometryAttribute::POSITION;
   72|    197|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    197|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    197|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 197]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    197|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 194]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    194|    predictor_.SetPositionAttribute(*att);
   82|    194|    return true;
   83|    197|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    193|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    193|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 187]
  ------------------
  148|      6|    return false;
  149|      6|  }
  150|       |
  151|    187|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    187|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    187|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 32, False: 155]
  ------------------
  153|     32|    uint8_t prediction_mode;
  154|     32|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 32]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     32|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 31]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     31|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 31]
  ------------------
  163|     31|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     31|  }
  167|    186|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    186|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 4, False: 182]
  ------------------
  171|      4|    return false;
  172|      4|  }
  173|       |
  174|    182|  return true;
  175|    186|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    182|                                      const PointIndex* entry_to_point_id_map) {
  103|    182|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    182|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    182|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    182|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    182|  const int corner_map_size =
  111|    182|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    182|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 182]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    182|  VectorD<int32_t, 3> pred_normal_3d;
  117|    182|  int32_t pred_normal_oct[2];
  118|       |
  119|   237k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 237k, False: 182]
  ------------------
  120|   237k|    const CornerIndex corner_id =
  121|   237k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   237k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   237k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   237k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   237k|                    octahedron_tool_box_.center_value());
  128|   237k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 201k, False: 35.7k]
  ------------------
  129|   201k|      pred_normal_3d = -pred_normal_3d;
  130|   201k|    }
  131|   237k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   237k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   237k|    const int data_offset = data_id * 2;
  135|   237k|    this->transform().ComputeOriginalValue(
  136|   237k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   237k|  }
  138|    182|  flip_normal_bit_decoder_.EndDecoding();
  139|    182|  return true;
  140|    182|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    182|  void SetQuantizationBits(int q) {
   85|    182|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    182|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    384|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    193|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    193|    DRACO_DCHECK_EQ(i, 0);
   70|    193|    (void)i;
   71|    193|    return GeometryAttribute::POSITION;
   72|    193|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    192|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    192|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 192]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    192|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 191]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    191|    predictor_.SetPositionAttribute(*att);
   82|    191|    return true;
   83|    192|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    189|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    189|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 13, False: 176]
  ------------------
  148|     13|    return false;
  149|     13|  }
  150|       |
  151|    176|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    176|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    176|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 28, False: 148]
  ------------------
  153|     28|    uint8_t prediction_mode;
  154|     28|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 28]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     28|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 26]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     26|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 26]
  ------------------
  163|     26|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     26|  }
  167|    174|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    174|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 12, False: 162]
  ------------------
  171|     12|    return false;
  172|     12|  }
  173|       |
  174|    162|  return true;
  175|    174|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    162|                                      const PointIndex* entry_to_point_id_map) {
  103|    162|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    162|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    162|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    162|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    162|  const int corner_map_size =
  111|    162|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    162|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 162]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    162|  VectorD<int32_t, 3> pred_normal_3d;
  117|    162|  int32_t pred_normal_oct[2];
  118|       |
  119|   396k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 396k, False: 162]
  ------------------
  120|   396k|    const CornerIndex corner_id =
  121|   396k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   396k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   396k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   396k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   396k|                    octahedron_tool_box_.center_value());
  128|   396k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 376k, False: 19.3k]
  ------------------
  129|   376k|      pred_normal_3d = -pred_normal_3d;
  130|   376k|    }
  131|   396k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   396k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   396k|    const int data_offset = data_id * 2;
  135|   396k|    this->transform().ComputeOriginalValue(
  136|   396k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   396k|  }
  138|    162|  flip_normal_bit_decoder_.EndDecoding();
  139|    162|  return true;
  140|    162|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    162|  void SetQuantizationBits(int q) {
   85|    162|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    162|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    321|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    161|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    161|    DRACO_DCHECK_EQ(i, 0);
   70|    161|    (void)i;
   71|    161|    return GeometryAttribute::POSITION;
   72|    161|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    161|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    161|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 161]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    161|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 160]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    160|    predictor_.SetPositionAttribute(*att);
   82|    160|    return true;
   83|    161|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    160|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    160|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 7, False: 153]
  ------------------
  148|      7|    return false;
  149|      7|  }
  150|       |
  151|    153|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    153|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    153|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 39, False: 114]
  ------------------
  153|     39|    uint8_t prediction_mode;
  154|     39|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 38]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     38|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 3, False: 35]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      3|      return false;
  160|      3|    }
  161|       |
  162|     35|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 35]
  ------------------
  163|     35|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     35|  }
  167|    149|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    149|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 3, False: 146]
  ------------------
  171|      3|    return false;
  172|      3|  }
  173|       |
  174|    146|  return true;
  175|    149|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    146|                                      const PointIndex* entry_to_point_id_map) {
  103|    146|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    146|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    146|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    146|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    146|  const int corner_map_size =
  111|    146|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    146|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 146]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    146|  VectorD<int32_t, 3> pred_normal_3d;
  117|    146|  int32_t pred_normal_oct[2];
  118|       |
  119|   182k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 182k, False: 146]
  ------------------
  120|   182k|    const CornerIndex corner_id =
  121|   182k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   182k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   182k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   182k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   182k|                    octahedron_tool_box_.center_value());
  128|   182k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 167k, False: 14.2k]
  ------------------
  129|   167k|      pred_normal_3d = -pred_normal_3d;
  130|   167k|    }
  131|   182k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   182k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   182k|    const int data_offset = data_id * 2;
  135|   182k|    this->transform().ComputeOriginalValue(
  136|   182k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   182k|  }
  138|    146|  flip_normal_bit_decoder_.EndDecoding();
  139|    146|  return true;
  140|    146|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    146|  void SetQuantizationBits(int q) {
   85|    146|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    146|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    499|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    499|            attribute, transform, mesh_data),
   37|    499|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    995|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    499|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    499|    DRACO_DCHECK_EQ(i, 0);
   70|    499|    (void)i;
   71|    499|    return GeometryAttribute::POSITION;
   72|    499|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    498|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    498|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 498]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    498|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 496]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    496|    predictor_.SetPositionAttribute(*att);
   82|    496|    return true;
   83|    498|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    490|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    490|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 26, False: 464]
  ------------------
  148|     26|    return false;
  149|     26|  }
  150|       |
  151|    464|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    464|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    464|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 152, False: 312]
  ------------------
  153|    152|    uint8_t prediction_mode;
  154|    152|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 152]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|    152|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 151]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|    151|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 151]
  ------------------
  163|    151|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|    151|  }
  167|    463|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    463|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 23, False: 440]
  ------------------
  171|     23|    return false;
  172|     23|  }
  173|       |
  174|    440|  return true;
  175|    463|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    440|                                      const PointIndex* entry_to_point_id_map) {
  103|    440|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    440|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    440|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    440|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    440|  const int corner_map_size =
  111|    440|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    440|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 440]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    440|  VectorD<int32_t, 3> pred_normal_3d;
  117|    440|  int32_t pred_normal_oct[2];
  118|       |
  119|  1.97M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 1.97M, False: 440]
  ------------------
  120|  1.97M|    const CornerIndex corner_id =
  121|  1.97M|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|  1.97M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|  1.97M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|  1.97M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|  1.97M|                    octahedron_tool_box_.center_value());
  128|  1.97M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 1.82M, False: 148k]
  ------------------
  129|  1.82M|      pred_normal_3d = -pred_normal_3d;
  130|  1.82M|    }
  131|  1.97M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|  1.97M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|  1.97M|    const int data_offset = data_id * 2;
  135|  1.97M|    this->transform().ComputeOriginalValue(
  136|  1.97M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|  1.97M|  }
  138|    440|  flip_normal_bit_decoder_.EndDecoding();
  139|    440|  return true;
  140|    440|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    440|  void SetQuantizationBits(int q) {
   85|    440|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    440|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    713|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    713|            attribute, transform, mesh_data),
   37|    713|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|  1.42k|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    713|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    713|    DRACO_DCHECK_EQ(i, 0);
   70|    713|    (void)i;
   71|    713|    return GeometryAttribute::POSITION;
   72|    713|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    712|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    712|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 712]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    712|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 711]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    711|    predictor_.SetPositionAttribute(*att);
   82|    711|    return true;
   83|    712|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    700|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    700|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 13, False: 687]
  ------------------
  148|     13|    return false;
  149|     13|  }
  150|       |
  151|    687|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    687|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    687|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 195, False: 492]
  ------------------
  153|    195|    uint8_t prediction_mode;
  154|    195|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 4, False: 191]
  ------------------
  155|      4|      return false;
  156|      4|    }
  157|    191|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 190]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|    190|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 190]
  ------------------
  163|    190|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|    190|  }
  167|    682|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    682|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 31, False: 651]
  ------------------
  171|     31|    return false;
  172|     31|  }
  173|       |
  174|    651|  return true;
  175|    682|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    651|                                      const PointIndex* entry_to_point_id_map) {
  103|    651|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    651|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    651|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    651|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    651|  const int corner_map_size =
  111|    651|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    651|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 651]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    651|  VectorD<int32_t, 3> pred_normal_3d;
  117|    651|  int32_t pred_normal_oct[2];
  118|       |
  119|   236k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 235k, False: 651]
  ------------------
  120|   235k|    const CornerIndex corner_id =
  121|   235k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   235k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   235k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   235k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   235k|                    octahedron_tool_box_.center_value());
  128|   235k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 210k, False: 25.7k]
  ------------------
  129|   210k|      pred_normal_3d = -pred_normal_3d;
  130|   210k|    }
  131|   235k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   235k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   235k|    const int data_offset = data_id * 2;
  135|   235k|    this->transform().ComputeOriginalValue(
  136|   235k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   235k|  }
  138|    651|  flip_normal_bit_decoder_.EndDecoding();
  139|    651|  return true;
  140|    651|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    651|  void SetQuantizationBits(int q) {
   85|    651|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    651|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    157|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    157|            attribute, transform, mesh_data),
   37|    157|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    197|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    197|            attribute, transform, mesh_data),
   37|    197|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    193|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    193|            attribute, transform, mesh_data),
   37|    193|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    161|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    161|            attribute, transform, mesh_data),
   37|    161|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    187|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    187|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 28, False: 159]
  ------------------
  105|     28|      this->normal_prediction_mode_ = mode;
  106|     28|      return true;
  107|    159|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 159, False: 0]
  ------------------
  108|    159|      this->normal_prediction_mode_ = mode;
  109|    159|      return true;
  110|    159|    }
  111|      0|    return false;
  112|    187|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.04M|                             DataTypeT* prediction) override {
   42|  1.04M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.04M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.04M|    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|  1.04M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.04M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.04M|    VectorD<int64_t, 3> normal;
   53|  1.04M|    CornerIndex c_next, c_prev;
   54|  2.24M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.20M, False: 1.04M]
  ------------------
   55|       |      // Getting corners.
   56|  1.20M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 138, False: 1.20M]
  ------------------
   57|    138|        c_next = corner_table->Next(corner_id);
   58|    138|        c_prev = corner_table->Previous(corner_id);
   59|  1.20M|      } else {
   60|  1.20M|        c_next = corner_table->Next(cit.Corner());
   61|  1.20M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.20M|      }
   63|  1.20M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.20M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.20M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.20M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.20M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.20M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.20M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.20M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.20M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.20M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.20M|      cit.Next();
   81|  1.20M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.04M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.04M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 92, False: 1.04M]
  ------------------
   86|     92|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     92|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 43, False: 49]
  ------------------
   88|     43|        const int64_t quotient = abs_sum / upper_bound;
   89|     43|        normal = normal / quotient;
   90|     43|      }
   91|  1.04M|    } else {
   92|  1.04M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.04M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.30k, False: 1.03M]
  ------------------
   94|  1.30k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.30k|        normal = normal / quotient;
   96|  1.30k|      }
   97|  1.04M|    }
   98|  1.04M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.04M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.04M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.04M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.04M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    228|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    228|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 29, False: 199]
  ------------------
  105|     29|      this->normal_prediction_mode_ = mode;
  106|     29|      return true;
  107|    199|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 199, False: 0]
  ------------------
  108|    199|      this->normal_prediction_mode_ = mode;
  109|    199|      return true;
  110|    199|    }
  111|      0|    return false;
  112|    228|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   237k|                             DataTypeT* prediction) override {
   42|   237k|    DRACO_DCHECK(this->IsInitialized());
   43|   237k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   237k|    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|   237k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   237k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   237k|    VectorD<int64_t, 3> normal;
   53|   237k|    CornerIndex c_next, c_prev;
   54|  1.65M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.41M, False: 237k]
  ------------------
   55|       |      // Getting corners.
   56|  1.41M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 168, False: 1.41M]
  ------------------
   57|    168|        c_next = corner_table->Next(corner_id);
   58|    168|        c_prev = corner_table->Previous(corner_id);
   59|  1.41M|      } else {
   60|  1.41M|        c_next = corner_table->Next(cit.Corner());
   61|  1.41M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.41M|      }
   63|  1.41M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.41M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.41M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.41M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.41M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.41M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.41M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.41M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.41M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.41M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.41M|      cit.Next();
   81|  1.41M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   237k|    constexpr int64_t upper_bound = 1 << 29;
   85|   237k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 112, False: 237k]
  ------------------
   86|    112|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    112|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 37, False: 75]
  ------------------
   88|     37|        const int64_t quotient = abs_sum / upper_bound;
   89|     37|        normal = normal / quotient;
   90|     37|      }
   91|   237k|    } else {
   92|   237k|      const int64_t abs_sum = normal.AbsSum();
   93|   237k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 126k, False: 110k]
  ------------------
   94|   126k|        const int64_t quotient = abs_sum / upper_bound;
   95|   126k|        normal = normal / quotient;
   96|   126k|      }
   97|   237k|    }
   98|   237k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   237k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   237k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   237k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   237k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    219|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    219|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 24, False: 195]
  ------------------
  105|     24|      this->normal_prediction_mode_ = mode;
  106|     24|      return true;
  107|    195|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 195, False: 0]
  ------------------
  108|    195|      this->normal_prediction_mode_ = mode;
  109|    195|      return true;
  110|    195|    }
  111|      0|    return false;
  112|    219|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   396k|                             DataTypeT* prediction) override {
   42|   396k|    DRACO_DCHECK(this->IsInitialized());
   43|   396k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   396k|    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|   396k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   396k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   396k|    VectorD<int64_t, 3> normal;
   53|   396k|    CornerIndex c_next, c_prev;
   54|  1.06M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 672k, False: 396k]
  ------------------
   55|       |      // Getting corners.
   56|   672k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 138, False: 672k]
  ------------------
   57|    138|        c_next = corner_table->Next(corner_id);
   58|    138|        c_prev = corner_table->Previous(corner_id);
   59|   672k|      } else {
   60|   672k|        c_next = corner_table->Next(cit.Corner());
   61|   672k|        c_prev = corner_table->Previous(cit.Corner());
   62|   672k|      }
   63|   672k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   672k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   672k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   672k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   672k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   672k|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|   672k|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|   672k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   672k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   672k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   672k|      cit.Next();
   81|   672k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   396k|    constexpr int64_t upper_bound = 1 << 29;
   85|   396k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 92, False: 396k]
  ------------------
   86|     92|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     92|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 23, False: 69]
  ------------------
   88|     23|        const int64_t quotient = abs_sum / upper_bound;
   89|     23|        normal = normal / quotient;
   90|     23|      }
   91|   396k|    } else {
   92|   396k|      const int64_t abs_sum = normal.AbsSum();
   93|   396k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.17k, False: 393k]
  ------------------
   94|  2.17k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.17k|        normal = normal / quotient;
   96|  2.17k|      }
   97|   396k|    }
   98|   396k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   396k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   396k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   396k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   396k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    196|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    196|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 34, False: 162]
  ------------------
  105|     34|      this->normal_prediction_mode_ = mode;
  106|     34|      return true;
  107|    162|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 162, False: 0]
  ------------------
  108|    162|      this->normal_prediction_mode_ = mode;
  109|    162|      return true;
  110|    162|    }
  111|      0|    return false;
  112|    196|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   182k|                             DataTypeT* prediction) override {
   42|   182k|    DRACO_DCHECK(this->IsInitialized());
   43|   182k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   182k|    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|   182k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   182k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   182k|    VectorD<int64_t, 3> normal;
   53|   182k|    CornerIndex c_next, c_prev;
   54|  1.26M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.08M, False: 182k]
  ------------------
   55|       |      // Getting corners.
   56|  1.08M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 198, False: 1.08M]
  ------------------
   57|    198|        c_next = corner_table->Next(corner_id);
   58|    198|        c_prev = corner_table->Previous(corner_id);
   59|  1.08M|      } else {
   60|  1.08M|        c_next = corner_table->Next(cit.Corner());
   61|  1.08M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.08M|      }
   63|  1.08M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.08M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.08M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.08M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.08M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.08M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.08M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.08M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.08M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.08M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.08M|      cit.Next();
   81|  1.08M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   182k|    constexpr int64_t upper_bound = 1 << 29;
   85|   182k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 132, False: 182k]
  ------------------
   86|    132|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    132|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 31, False: 101]
  ------------------
   88|     31|        const int64_t quotient = abs_sum / upper_bound;
   89|     31|        normal = normal / quotient;
   90|     31|      }
   91|   182k|    } else {
   92|   182k|      const int64_t abs_sum = normal.AbsSum();
   93|   182k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 78.0k, False: 103k]
  ------------------
   94|  78.0k|        const int64_t quotient = abs_sum / upper_bound;
   95|  78.0k|        normal = normal / quotient;
   96|  78.0k|      }
   97|   182k|    }
   98|   182k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   182k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   182k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   182k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   182k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    499|      : Base(md) {
   35|    499|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    499|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    650|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    650|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 149, False: 501]
  ------------------
  105|    149|      this->normal_prediction_mode_ = mode;
  106|    149|      return true;
  107|    501|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 501, False: 0]
  ------------------
  108|    501|      this->normal_prediction_mode_ = mode;
  109|    501|      return true;
  110|    501|    }
  111|      0|    return false;
  112|    650|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.97M|                             DataTypeT* prediction) override {
   42|  1.97M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.97M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.97M|    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|  1.97M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.97M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.97M|    VectorD<int64_t, 3> normal;
   53|  1.97M|    CornerIndex c_next, c_prev;
   54|  4.01M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 2.04M, False: 1.97M]
  ------------------
   55|       |      // Getting corners.
   56|  2.04M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 834, False: 2.03M]
  ------------------
   57|    834|        c_next = corner_table->Next(corner_id);
   58|    834|        c_prev = corner_table->Previous(corner_id);
   59|  2.03M|      } else {
   60|  2.03M|        c_next = corner_table->Next(cit.Corner());
   61|  2.03M|        c_prev = corner_table->Previous(cit.Corner());
   62|  2.03M|      }
   63|  2.04M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  2.04M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  2.04M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  2.04M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  2.04M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  2.04M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  2.04M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  2.04M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  2.04M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  2.04M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  2.04M|      cit.Next();
   81|  2.04M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.97M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.97M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 776, False: 1.97M]
  ------------------
   86|    776|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    776|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 206, False: 570]
  ------------------
   88|    206|        const int64_t quotient = abs_sum / upper_bound;
   89|    206|        normal = normal / quotient;
   90|    206|      }
   91|  1.97M|    } else {
   92|  1.97M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.97M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.72k, False: 1.96M]
  ------------------
   94|  3.72k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.72k|        normal = normal / quotient;
   96|  3.72k|      }
   97|  1.97M|    }
   98|  1.97M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.97M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.97M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.97M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.97M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    713|      : Base(md) {
   35|    713|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    713|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    903|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    903|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 188, False: 715]
  ------------------
  105|    188|      this->normal_prediction_mode_ = mode;
  106|    188|      return true;
  107|    715|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 715, False: 0]
  ------------------
  108|    715|      this->normal_prediction_mode_ = mode;
  109|    715|      return true;
  110|    715|    }
  111|      0|    return false;
  112|    903|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   235k|                             DataTypeT* prediction) override {
   42|   235k|    DRACO_DCHECK(this->IsInitialized());
   43|   235k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   235k|    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|   235k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   235k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   235k|    VectorD<int64_t, 3> normal;
   53|   235k|    CornerIndex c_next, c_prev;
   54|  1.55M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.31M, False: 235k]
  ------------------
   55|       |      // Getting corners.
   56|  1.31M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 1.11k, False: 1.31M]
  ------------------
   57|  1.11k|        c_next = corner_table->Next(corner_id);
   58|  1.11k|        c_prev = corner_table->Previous(corner_id);
   59|  1.31M|      } else {
   60|  1.31M|        c_next = corner_table->Next(cit.Corner());
   61|  1.31M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.31M|      }
   63|  1.31M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.31M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.31M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.31M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.31M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.31M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.31M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.31M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.31M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.31M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.31M|      cit.Next();
   81|  1.31M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   235k|    constexpr int64_t upper_bound = 1 << 29;
   85|   235k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 1.06k, False: 234k]
  ------------------
   86|  1.06k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  1.06k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 350, False: 718]
  ------------------
   88|    350|        const int64_t quotient = abs_sum / upper_bound;
   89|    350|        normal = normal / quotient;
   90|    350|      }
   91|   234k|    } else {
   92|   234k|      const int64_t abs_sum = normal.AbsSum();
   93|   234k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 8.47k, False: 226k]
  ------------------
   94|  8.47k|        const int64_t quotient = abs_sum / upper_bound;
   95|  8.47k|        normal = normal / quotient;
   96|  8.47k|      }
   97|   234k|    }
   98|   235k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   235k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   235k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   235k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   235k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    157|      : Base(md) {
   35|    157|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    157|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    197|      : Base(md) {
   35|    197|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    197|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    193|      : Base(md) {
   35|    193|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    193|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    161|      : Base(md) {
   35|    161|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    161|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.45M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.45M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.45M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.45M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.45M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.45M|    return GetPositionForDataId(data_id);
   77|  3.45M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.45M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.45M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.45M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.45M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.45M|    VectorD<int64_t, 3> pos;
   68|  3.45M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.45M|    return pos;
   70|  3.45M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    156|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    156|    pos_attribute_ = &position_attribute;
   43|    156|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    136|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    136|    entry_to_point_id_map_ = map;
   46|    136|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.06M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.06M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.06M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.06M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.06M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.06M|    return GetPositionForDataId(data_id);
   77|  3.06M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.06M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.06M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.06M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.06M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.06M|    VectorD<int64_t, 3> pos;
   68|  3.06M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.06M|    return pos;
   70|  3.06M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    194|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    194|    pos_attribute_ = &position_attribute;
   43|    194|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    182|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    182|    entry_to_point_id_map_ = map;
   46|    182|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_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_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   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_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    191|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    191|    pos_attribute_ = &position_attribute;
   43|    191|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    162|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    162|    entry_to_point_id_map_ = map;
   46|    162|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.35M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.35M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.35M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.35M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.35M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.35M|    return GetPositionForDataId(data_id);
   77|  2.35M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.35M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.35M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.35M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.35M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.35M|    VectorD<int64_t, 3> pos;
   68|  2.35M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.35M|    return pos;
   70|  2.35M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    160|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    160|    pos_attribute_ = &position_attribute;
   43|    160|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    146|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    146|    entry_to_point_id_map_ = map;
   46|    146|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    499|      : pos_attribute_(nullptr),
   36|    499|        entry_to_point_id_map_(nullptr),
   37|    499|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    499|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  6.05M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  6.05M|    DRACO_DCHECK(this->IsInitialized());
   73|  6.05M|    const auto corner_table = mesh_data_.corner_table();
   74|  6.05M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  6.05M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  6.05M|    return GetPositionForDataId(data_id);
   77|  6.05M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  6.05M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  6.05M|    DRACO_DCHECK(this->IsInitialized());
   65|  6.05M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  6.05M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  6.05M|    VectorD<int64_t, 3> pos;
   68|  6.05M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  6.05M|    return pos;
   70|  6.05M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    496|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    496|    pos_attribute_ = &position_attribute;
   43|    496|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    440|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    440|    entry_to_point_id_map_ = map;
   46|    440|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    713|      : pos_attribute_(nullptr),
   36|    713|        entry_to_point_id_map_(nullptr),
   37|    713|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    713|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.87M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.87M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.87M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.87M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.87M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.87M|    return GetPositionForDataId(data_id);
   77|  2.87M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.87M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.87M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.87M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.87M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.87M|    VectorD<int64_t, 3> pos;
   68|  2.87M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.87M|    return pos;
   70|  2.87M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    711|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    711|    pos_attribute_ = &position_attribute;
   43|    711|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    651|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    651|    entry_to_point_id_map_ = map;
   46|    651|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    157|      : pos_attribute_(nullptr),
   36|    157|        entry_to_point_id_map_(nullptr),
   37|    157|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    157|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    197|      : pos_attribute_(nullptr),
   36|    197|        entry_to_point_id_map_(nullptr),
   37|    197|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    197|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    193|      : pos_attribute_(nullptr),
   36|    193|        entry_to_point_id_map_(nullptr),
   37|    193|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    193|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    161|      : pos_attribute_(nullptr),
   36|    161|        entry_to_point_id_map_(nullptr),
   37|    161|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    161|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    510|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    510|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    491|                          const PointIndex* /* entry_to_point_id_map */) {
   64|    491|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    491|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    491|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    491|      new DataTypeT[num_components]());
   70|       |
   71|    491|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    491|  const CornerTable* const table = this->mesh_data().corner_table();
   74|    491|  const std::vector<int32_t>* const vertex_to_data_map =
   75|    491|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    491|  const int corner_map_size =
   78|    491|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    491|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 491]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|  1.71M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 1.71M, False: 491]
  ------------------
   83|  1.71M|    const CornerIndex start_corner_id =
   84|  1.71M|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|  1.71M|    CornerIndex corner_id(start_corner_id);
   87|  1.71M|    int num_parallelograms = 0;
   88|   128M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 126M, False: 1.71M]
  ------------------
   89|   126M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|   126M|    }
   91|  3.84M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 2.13M, False: 1.71M]
  ------------------
   92|  2.13M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 170k, False: 1.96M]
  ------------------
   93|  2.13M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  2.13M|              num_components, parallelogram_pred_vals.get())) {
   95|  8.30M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 8.13M, False: 170k]
  ------------------
   96|  8.13M|          pred_vals[c] =
   97|  8.13M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  8.13M|        }
   99|   170k|        ++num_parallelograms;
  100|   170k|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  2.13M|      corner_id = table->SwingRight(corner_id);
  104|  2.13M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 79.7k, False: 2.05M]
  ------------------
  105|  79.7k|        corner_id = kInvalidCornerIndex;
  106|  79.7k|      }
  107|  2.13M|    }
  108|       |
  109|  1.71M|    const int dst_offset = p * num_components;
  110|  1.71M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 1.62M, False: 91.7k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  1.62M|      const int src_offset = (p - 1) * num_components;
  114|  1.62M|      this->transform().ComputeOriginalValue(
  115|  1.62M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|  1.62M|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  4.49M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 4.40M, False: 91.7k]
  ------------------
  119|  4.40M|        pred_vals[c] /= num_parallelograms;
  120|  4.40M|      }
  121|  91.7k|      this->transform().ComputeOriginalValue(
  122|  91.7k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|  91.7k|    }
  124|  1.71M|  }
  125|    491|  return true;
  126|    491|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    599|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    599|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    578|                          const PointIndex* /* entry_to_point_id_map */) {
   64|    578|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    578|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    578|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    578|      new DataTypeT[num_components]());
   70|       |
   71|    578|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    578|  const CornerTable* const table = this->mesh_data().corner_table();
   74|    578|  const std::vector<int32_t>* const vertex_to_data_map =
   75|    578|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    578|  const int corner_map_size =
   78|    578|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    578|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 578]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|   969k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 968k, False: 578]
  ------------------
   83|   968k|    const CornerIndex start_corner_id =
   84|   968k|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|   968k|    CornerIndex corner_id(start_corner_id);
   87|   968k|    int num_parallelograms = 0;
   88|  32.6M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 31.6M, False: 968k]
  ------------------
   89|  31.6M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  31.6M|    }
   91|  6.69M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 5.73M, False: 968k]
  ------------------
   92|  5.73M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 1.89M, False: 3.83M]
  ------------------
   93|  5.73M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  5.73M|              num_components, parallelogram_pred_vals.get())) {
   95|  63.7M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 61.8M, False: 1.89M]
  ------------------
   96|  61.8M|          pred_vals[c] =
   97|  61.8M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  61.8M|        }
   99|  1.89M|        ++num_parallelograms;
  100|  1.89M|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  5.73M|      corner_id = table->SwingRight(corner_id);
  104|  5.73M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 949k, False: 4.78M]
  ------------------
  105|   949k|        corner_id = kInvalidCornerIndex;
  106|   949k|      }
  107|  5.73M|    }
  108|       |
  109|   968k|    const int dst_offset = p * num_components;
  110|   968k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 1.97k, False: 966k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  1.97k|      const int src_offset = (p - 1) * num_components;
  114|  1.97k|      this->transform().ComputeOriginalValue(
  115|  1.97k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|   966k|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  32.5M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 31.5M, False: 966k]
  ------------------
  119|  31.5M|        pred_vals[c] /= num_parallelograms;
  120|  31.5M|      }
  121|   966k|      this->transform().ComputeOriginalValue(
  122|   966k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|   966k|    }
  124|   968k|  }
  125|    578|  return true;
  126|    578|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  4.92M|    int num_components, DataTypeT* out_prediction) {
   49|  4.92M|  const CornerIndex oci = table->Opposite(ci);
   50|  4.92M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 4.21M, False: 717k]
  ------------------
   51|  4.21M|    return false;
   52|  4.21M|  }
   53|   717k|  int vert_opp, vert_next, vert_prev;
   54|   717k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   717k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   717k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 381k, False: 335k]
  |  Branch (56:35): [True: 294k, False: 87.2k]
  ------------------
   57|   294k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 276k, False: 17.8k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   276k|    const int v_opp_off = vert_opp * num_components;
   60|   276k|    const int v_next_off = vert_next * num_components;
   61|   276k|    const int v_prev_off = vert_prev * num_components;
   62|  16.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 16.2M, False: 276k]
  ------------------
   63|  16.2M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  16.2M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  16.2M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  16.2M|      const int64_t result =
   67|  16.2M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  16.2M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  16.2M|    }
   71|   276k|    return true;
   72|   276k|  }
   73|   440k|  return false;  // Not all data is available for prediction
   74|   717k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   717k|    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|   717k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   717k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   717k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   717k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  7.62M|    int num_components, DataTypeT* out_prediction) {
   49|  7.62M|  const CornerIndex oci = table->Opposite(ci);
   50|  7.62M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 28.7k, False: 7.60M]
  ------------------
   51|  28.7k|    return false;
   52|  28.7k|  }
   53|  7.60M|  int vert_opp, vert_next, vert_prev;
   54|  7.60M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  7.60M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  7.60M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 4.08M, False: 3.51M]
  |  Branch (56:35): [True: 3.20M, False: 882k]
  ------------------
   57|  3.20M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.92M, False: 279k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.92M|    const int v_opp_off = vert_opp * num_components;
   60|  2.92M|    const int v_next_off = vert_next * num_components;
   61|  2.92M|    const int v_prev_off = vert_prev * num_components;
   62|   122M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 119M, False: 2.92M]
  ------------------
   63|   119M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|   119M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|   119M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|   119M|      const int64_t result =
   67|   119M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|   119M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|   119M|    }
   71|  2.92M|    return true;
   72|  2.92M|  }
   73|  4.67M|  return false;  // Not all data is available for prediction
   74|  7.60M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  7.60M|    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|  7.60M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  7.60M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  7.60M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  7.60M|}

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

_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    430|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   39|    430|            attribute, transform, mesh_data),
   40|    430|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   62|    856|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   64|    430|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   65|    430|    DRACO_DCHECK_EQ(i, 0);
   66|    430|    (void)i;
   67|    430|    return GeometryAttribute::POSITION;
   68|    430|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   70|    428|  bool SetParentAttribute(const PointAttribute* att) override {
   71|    428|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (71:9): [True: 0, False: 428]
  |  Branch (71:17): [True: 0, False: 428]
  ------------------
   72|      0|      return false;  // Invalid attribute type.
   73|      0|    }
   74|    428|    if (att->num_components() != 3) {
  ------------------
  |  Branch (74:9): [True: 2, False: 426]
  ------------------
   75|      2|      return false;  // Currently works only for 3 component positions.
   76|      2|    }
   77|    426|    predictor_.SetPositionAttribute(*att);
   78|    426|    return true;
   79|    428|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  128|    423|                                                                buffer) {
  129|       |  // Decode the delta coded orientations.
  130|    423|  int32_t num_orientations = 0;
  131|    423|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (131:7): [True: 2, False: 421]
  |  Branch (131:45): [True: 16, False: 405]
  ------------------
  132|     18|    return false;
  133|     18|  }
  134|       |
  135|       |  // Check that the decoded number of orientations is not unreasonably high.
  136|    405|  const int32_t max_num_orientations = max_num_predicted_values_;
  137|    405|  if (max_num_orientations != -1 && num_orientations > max_num_orientations) {
  ------------------
  |  Branch (137:7): [True: 405, False: 0]
  |  Branch (137:37): [True: 26, False: 379]
  ------------------
  138|     26|    return false;
  139|     26|  }
  140|       |
  141|    379|  predictor_.ResizeOrientations(num_orientations);
  142|    379|  bool last_orientation = true;
  143|    379|  RAnsBitDecoder decoder;
  144|    379|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 374]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|   137k|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (147:19): [True: 136k, False: 374]
  ------------------
  148|   136k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (148:9): [True: 7.54k, False: 129k]
  ------------------
  149|  7.54k|      last_orientation = !last_orientation;
  150|  7.54k|    }
  151|   136k|    predictor_.set_orientation(i, last_orientation);
  152|   136k|  }
  153|    374|  decoder.EndDecoding();
  154|    374|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  155|    374|                                     MeshDataT>::DecodePredictionData(buffer);
  156|    379|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE24SetMaxNumPredictedValuesEi:
   81|    423|  virtual void SetMaxNumPredictedValues(int32_t num) {
   82|    423|    max_num_predicted_values_ = num;
   83|    423|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   97|    328|                                      const PointIndex* entry_to_point_id_map) {
   98|    328|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (98:7): [True: 11, False: 317]
  ------------------
   99|    328|                            DataTypeT, MeshDataT>::kNumComponents) {
  100|     11|    return false;
  101|     11|  }
  102|    317|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  103|    317|  this->transform().Init(num_components);
  104|       |
  105|    317|  const int corner_map_size =
  106|    317|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  107|    317|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (107:7): [True: 0, False: 317]
  ------------------
  108|      0|    return false;
  109|      0|  }
  110|  1.07M|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 1.07M, False: 191]
  ------------------
  111|  1.07M|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  112|  1.07M|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (112:9): [True: 126, False: 1.07M]
  ------------------
  113|  1.07M|                                                          p)) {
  114|    126|      return false;
  115|    126|    }
  116|       |
  117|  1.07M|    const int dst_offset = p * num_components;
  118|  1.07M|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  119|  1.07M|                                           in_corr + dst_offset,
  120|  1.07M|                                           out_data + dst_offset);
  121|  1.07M|  }
  122|    191|  return true;
  123|    317|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    329|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   39|    329|            attribute, transform, mesh_data),
   40|    329|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   62|    655|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   64|    329|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   65|    329|    DRACO_DCHECK_EQ(i, 0);
   66|    329|    (void)i;
   67|    329|    return GeometryAttribute::POSITION;
   68|    329|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   70|    327|  bool SetParentAttribute(const PointAttribute* att) override {
   71|    327|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (71:9): [True: 0, False: 327]
  |  Branch (71:17): [True: 0, False: 327]
  ------------------
   72|      0|      return false;  // Invalid attribute type.
   73|      0|    }
   74|    327|    if (att->num_components() != 3) {
  ------------------
  |  Branch (74:9): [True: 1, False: 326]
  ------------------
   75|      1|      return false;  // Currently works only for 3 component positions.
   76|      1|    }
   77|    326|    predictor_.SetPositionAttribute(*att);
   78|    326|    return true;
   79|    327|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  128|    319|                                                                buffer) {
  129|       |  // Decode the delta coded orientations.
  130|    319|  int32_t num_orientations = 0;
  131|    319|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (131:7): [True: 1, False: 318]
  |  Branch (131:45): [True: 32, False: 286]
  ------------------
  132|     33|    return false;
  133|     33|  }
  134|       |
  135|       |  // Check that the decoded number of orientations is not unreasonably high.
  136|    286|  const int32_t max_num_orientations = max_num_predicted_values_;
  137|    286|  if (max_num_orientations != -1 && num_orientations > max_num_orientations) {
  ------------------
  |  Branch (137:7): [True: 286, False: 0]
  |  Branch (137:37): [True: 19, False: 267]
  ------------------
  138|     19|    return false;
  139|     19|  }
  140|       |
  141|    267|  predictor_.ResizeOrientations(num_orientations);
  142|    267|  bool last_orientation = true;
  143|    267|  RAnsBitDecoder decoder;
  144|    267|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (144:7): [True: 4, False: 263]
  ------------------
  145|      4|    return false;
  146|      4|  }
  147|   139k|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (147:19): [True: 139k, False: 263]
  ------------------
  148|   139k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (148:9): [True: 2.01k, False: 137k]
  ------------------
  149|  2.01k|      last_orientation = !last_orientation;
  150|  2.01k|    }
  151|   139k|    predictor_.set_orientation(i, last_orientation);
  152|   139k|  }
  153|    263|  decoder.EndDecoding();
  154|    263|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  155|    263|                                     MeshDataT>::DecodePredictionData(buffer);
  156|    267|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE24SetMaxNumPredictedValuesEi:
   81|    319|  virtual void SetMaxNumPredictedValues(int32_t num) {
   82|    319|    max_num_predicted_values_ = num;
   83|    319|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   97|    242|                                      const PointIndex* entry_to_point_id_map) {
   98|    242|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (98:7): [True: 13, False: 229]
  ------------------
   99|    242|                            DataTypeT, MeshDataT>::kNumComponents) {
  100|     13|    return false;
  101|     13|  }
  102|    229|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  103|    229|  this->transform().Init(num_components);
  104|       |
  105|    229|  const int corner_map_size =
  106|    229|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  107|    229|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (107:7): [True: 0, False: 229]
  ------------------
  108|      0|    return false;
  109|      0|  }
  110|   271k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 271k, False: 87]
  ------------------
  111|   271k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  112|   271k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (112:9): [True: 142, False: 271k]
  ------------------
  113|   271k|                                                          p)) {
  114|    142|      return false;
  115|    142|    }
  116|       |
  117|   271k|    const int dst_offset = p * num_components;
  118|   271k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  119|   271k|                                           in_corr + dst_offset,
  120|   271k|                                           out_data + dst_offset);
  121|   271k|  }
  122|     87|  return true;
  123|    229|}

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

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    162|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    497|  bool AreCorrectionsPositive() override {
   71|    497|    return transform_.AreCorrectionsPositive();
   72|    497|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    149|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|    149|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 17, False: 132]
  ------------------
   50|     17|      return false;
   51|     17|    }
   52|    132|    return true;
   53|    149|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  37.5M|  inline Transform& transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    255|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    591|  bool AreCorrectionsPositive() override {
   71|    591|    return transform_.AreCorrectionsPositive();
   72|    591|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    242|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|    242|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 24, False: 218]
  ------------------
   50|     24|      return false;
   51|     24|    }
   52|    218|    return true;
   53|    242|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   150M|  inline Transform& transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  7.08k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  4.61k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  6.84k|  bool AreCorrectionsPositive() override {
   71|  6.84k|    return transform_.AreCorrectionsPositive();
   72|  6.84k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  5.20k|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|  5.20k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 332, False: 4.87k]
  ------------------
   50|    332|      return false;
   51|    332|    }
   52|  4.87k|    return true;
   53|  5.20k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  70.1M|  inline Transform& transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    516|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    609|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    516|                                 const PointCloudDecoder* decoder) {
  188|    516|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    516|      method, att_id, decoder, TransformT());
  190|    516|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    516|                                 const TransformT& transform) {
  156|    516|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 516]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    516|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|    516|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 456, False: 60]
  ------------------
  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|    456|    const MeshDecoder* const mesh_decoder =
  167|    456|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|    456|    auto ret = CreateMeshPredictionScheme<
  170|    456|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    456|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    456|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    456|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 354, False: 102]
  ------------------
  174|    354|      return ret;
  175|    354|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    456|  }
  178|       |  // Create delta decoder.
  179|    162|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    162|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    516|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    172|      uint16_t bitstream_version) {
  143|    172|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    172|        method, attribute, transform, mesh_data, bitstream_version);
  145|    172|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    172|        uint16_t bitstream_version) {
  127|    172|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 157, False: 15]
  ------------------
  128|    157|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    157|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    157|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    157|                                                  mesh_data));
  132|    157|      }
  133|     15|      return nullptr;
  134|    172|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    205|      uint16_t bitstream_version) {
  143|    205|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    205|        method, attribute, transform, mesh_data, bitstream_version);
  145|    205|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    205|        uint16_t bitstream_version) {
  127|    205|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 197, False: 8]
  ------------------
  128|    197|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    197|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    197|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    197|                                                  mesh_data));
  132|    197|      }
  133|      8|      return nullptr;
  134|    205|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    609|                                 const PointCloudDecoder* decoder) {
  188|    609|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    609|      method, att_id, decoder, TransformT());
  190|    609|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    609|                                 const TransformT& transform) {
  156|    609|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 609]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    609|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|    609|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 592, False: 17]
  ------------------
  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|    592|    const MeshDecoder* const mesh_decoder =
  167|    592|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|    592|    auto ret = CreateMeshPredictionScheme<
  170|    592|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    592|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    592|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    592|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 354, False: 238]
  ------------------
  174|    354|      return ret;
  175|    354|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    592|  }
  178|       |  // Create delta decoder.
  179|    255|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    255|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    609|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    209|      uint16_t bitstream_version) {
  143|    209|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    209|        method, attribute, transform, mesh_data, bitstream_version);
  145|    209|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    209|        uint16_t bitstream_version) {
  111|    209|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 193, False: 16]
  ------------------
  112|    193|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    193|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    193|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    193|                                                  mesh_data));
  116|    193|      }
  117|     16|      return nullptr;
  118|    209|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    172|      uint16_t bitstream_version) {
  143|    172|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    172|        method, attribute, transform, mesh_data, bitstream_version);
  145|    172|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    172|        uint16_t bitstream_version) {
  111|    172|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 161, False: 11]
  ------------------
  112|    161|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    161|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    161|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    161|                                                  mesh_data));
  116|    161|      }
  117|     11|      return nullptr;
  118|    172|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  7.08k|                                 const PointCloudDecoder* decoder) {
  188|  7.08k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  7.08k|      method, att_id, decoder, TransformT());
  190|  7.08k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  7.08k|                                 const TransformT& transform) {
  156|  7.08k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 7.08k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  7.08k|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|  7.08k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 7.04k, False: 38]
  ------------------
  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|  7.04k|    const MeshDecoder* const mesh_decoder =
  167|  7.04k|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|  7.04k|    auto ret = CreateMeshPredictionScheme<
  170|  7.04k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  7.04k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  7.04k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  7.04k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 6.58k, False: 463]
  ------------------
  174|  6.58k|      return ret;
  175|  6.58k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  7.04k|  }
  178|       |  // Create delta decoder.
  179|    501|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    501|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  7.08k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  3.05k|      uint16_t bitstream_version) {
  143|  3.05k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  3.05k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  3.05k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  3.05k|        uint16_t bitstream_version) {
   53|  3.05k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 795, False: 2.25k]
  ------------------
   54|    795|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    795|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    795|                                                         MeshDataT>(
   57|    795|                attribute, transform, mesh_data));
   58|    795|      }
   59|  2.25k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.25k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 510, False: 1.74k]
  ------------------
   61|    510|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    510|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    510|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    510|                                                  mesh_data));
   65|    510|      }
   66|  1.74k|#endif
   67|  1.74k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 576, False: 1.17k]
  ------------------
   68|    576|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    576|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    576|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    576|                                                  mesh_data));
   72|    576|      }
   73|  1.17k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|  1.17k|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 243, False: 929]
  ------------------
   75|    243|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    243|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    243|                                                     MeshDataT>(
   78|    243|                attribute, transform, mesh_data, bitstream_version));
   79|    243|      }
   80|    929|#endif
   81|    929|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 430, False: 499]
  ------------------
   82|    430|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    430|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    430|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    430|                                                  mesh_data));
   86|    430|      }
   87|    499|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    499|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 499, False: 0]
  ------------------
   89|    499|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    499|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    499|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    499|                                                  mesh_data));
   93|    499|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  3.05k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  3.53k|      uint16_t bitstream_version) {
  143|  3.53k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  3.53k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  3.53k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  3.53k|        uint16_t bitstream_version) {
   53|  3.53k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 883, False: 2.64k]
  ------------------
   54|    883|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    883|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    883|                                                         MeshDataT>(
   57|    883|                attribute, transform, mesh_data));
   58|    883|      }
   59|  2.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.64k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 599, False: 2.05k]
  ------------------
   61|    599|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    599|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    599|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    599|                                                  mesh_data));
   65|    599|      }
   66|  2.05k|#endif
   67|  2.05k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 751, False: 1.29k]
  ------------------
   68|    751|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    751|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    751|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    751|                                                  mesh_data));
   72|    751|      }
   73|  1.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|  1.29k|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 257, False: 1.04k]
  ------------------
   75|    257|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    257|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    257|                                                     MeshDataT>(
   78|    257|                attribute, transform, mesh_data, bitstream_version));
   79|    257|      }
   80|  1.04k|#endif
   81|  1.04k|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 329, False: 713]
  ------------------
   82|    329|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    329|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    329|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    329|                                                  mesh_data));
   86|    329|      }
   87|    713|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    713|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 713, False: 0]
  ------------------
   89|    713|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    713|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    713|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    713|                                                  mesh_data));
   93|    713|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  3.53k|    }

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

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    132|    const PointIndex*) {
   50|    132|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    132|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    132|  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|  36.3M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 36.3M, False: 132]
  ------------------
   57|  36.3M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  36.3M|                                           in_corr + i, out_data + i);
   59|  36.3M|  }
   60|    132|  return true;
   61|    132|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    218|    const PointIndex*) {
   50|    218|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    218|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    218|  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|   149M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 149M, False: 218]
  ------------------
   57|   149M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   149M|                                           in_corr + i, out_data + i);
   59|   149M|  }
   60|    218|  return true;
   61|    218|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    501|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    378|    const PointIndex*) {
   50|    378|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    378|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    378|  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|  59.1M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 59.1M, False: 378]
  ------------------
   57|  59.1M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  59.1M|                                           in_corr + i, out_data + i);
   59|  59.1M|  }
   60|    378|  return true;
   61|    378|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    162|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    255|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    456|    uint16_t bitstream_version) {
   38|    456|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|    456|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 456, False: 0]
  ------------------
   40|    456|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 16, False: 440]
  ------------------
   41|    440|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 7, False: 433]
  ------------------
   42|    433|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 5, False: 428]
  ------------------
   43|    428|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 12, False: 416]
  ------------------
   44|    416|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 399, False: 17]
  ------------------
   45|    445|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 6, False: 11]
  ------------------
   46|    445|    const CornerTable* const ct = source->GetCornerTable();
   47|    445|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|    445|        source->GetAttributeEncodingData(att_id);
   49|    445|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 68, False: 377]
  |  Branch (49:26): [True: 0, False: 377]
  ------------------
   50|       |      // No connectivity data found.
   51|     68|      return nullptr;
   52|     68|    }
   53|       |    // Connectivity data exists.
   54|    377|    const MeshAttributeCornerTable* const att_ct =
   55|    377|        source->GetAttributeCornerTable(att_id);
   56|    377|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 172, False: 205]
  ------------------
   57|    172|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    172|      MeshData md;
   59|    172|      md.Set(source->mesh(), att_ct,
   60|    172|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    172|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    172|      MeshPredictionSchemeFactoryT factory;
   63|    172|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    172|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 157, False: 15]
  ------------------
   65|    157|        return ret;
   66|    157|      }
   67|    205|    } else {
   68|    205|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    205|      MeshData md;
   70|    205|      md.Set(source->mesh(), ct,
   71|    205|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    205|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    205|      MeshPredictionSchemeFactoryT factory;
   74|    205|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    205|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 197, False: 8]
  ------------------
   76|    197|        return ret;
   77|    197|      }
   78|    205|    }
   79|    377|  }
   80|     34|  return nullptr;
   81|    456|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    592|    uint16_t bitstream_version) {
   38|    592|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|    592|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 592, False: 0]
  ------------------
   40|    592|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 21, False: 571]
  ------------------
   41|    571|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 5, False: 566]
  ------------------
   42|    566|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 16, False: 550]
  ------------------
   43|    550|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 2, False: 548]
  ------------------
   44|    548|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 514, False: 34]
  ------------------
   45|    566|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 8, False: 26]
  ------------------
   46|    566|    const CornerTable* const ct = source->GetCornerTable();
   47|    566|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|    566|        source->GetAttributeEncodingData(att_id);
   49|    566|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 185, False: 381]
  |  Branch (49:26): [True: 0, False: 381]
  ------------------
   50|       |      // No connectivity data found.
   51|    185|      return nullptr;
   52|    185|    }
   53|       |    // Connectivity data exists.
   54|    381|    const MeshAttributeCornerTable* const att_ct =
   55|    381|        source->GetAttributeCornerTable(att_id);
   56|    381|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 209, False: 172]
  ------------------
   57|    209|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    209|      MeshData md;
   59|    209|      md.Set(source->mesh(), att_ct,
   60|    209|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    209|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    209|      MeshPredictionSchemeFactoryT factory;
   63|    209|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    209|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 193, False: 16]
  ------------------
   65|    193|        return ret;
   66|    193|      }
   67|    209|    } else {
   68|    172|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    172|      MeshData md;
   70|    172|      md.Set(source->mesh(), ct,
   71|    172|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    172|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    172|      MeshPredictionSchemeFactoryT factory;
   74|    172|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    172|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 161, False: 11]
  ------------------
   76|    161|        return ret;
   77|    161|      }
   78|    172|    }
   79|    381|  }
   80|     53|  return nullptr;
   81|    592|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  7.04k|    uint16_t bitstream_version) {
   38|  7.04k|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|  7.04k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 7.04k, False: 0]
  ------------------
   40|  7.04k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.91k, False: 5.13k]
  ------------------
   41|  5.13k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1.11k, False: 4.02k]
  ------------------
   42|  4.02k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1.32k, False: 2.70k]
  ------------------
   43|  2.70k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 760, False: 1.94k]
  ------------------
   44|  1.94k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 1.22k, False: 715]
  ------------------
   45|  6.83k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 501, False: 214]
  ------------------
   46|  6.83k|    const CornerTable* const ct = source->GetCornerTable();
   47|  6.83k|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|  6.83k|        source->GetAttributeEncodingData(att_id);
   49|  6.83k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 249, False: 6.58k]
  |  Branch (49:26): [True: 0, False: 6.58k]
  ------------------
   50|       |      // No connectivity data found.
   51|    249|      return nullptr;
   52|    249|    }
   53|       |    // Connectivity data exists.
   54|  6.58k|    const MeshAttributeCornerTable* const att_ct =
   55|  6.58k|        source->GetAttributeCornerTable(att_id);
   56|  6.58k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 3.05k, False: 3.53k]
  ------------------
   57|  3.05k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  3.05k|      MeshData md;
   59|  3.05k|      md.Set(source->mesh(), att_ct,
   60|  3.05k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  3.05k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  3.05k|      MeshPredictionSchemeFactoryT factory;
   63|  3.05k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  3.05k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 3.05k, False: 0]
  ------------------
   65|  3.05k|        return ret;
   66|  3.05k|      }
   67|  3.53k|    } else {
   68|  3.53k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  3.53k|      MeshData md;
   70|  3.53k|      md.Set(source->mesh(), ct,
   71|  3.53k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  3.53k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  3.53k|      MeshPredictionSchemeFactoryT factory;
   74|  3.53k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  3.53k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 3.53k, False: 0]
  ------------------
   76|  3.53k|        return ret;
   77|  3.53k|      }
   78|  3.53k|    }
   79|  6.58k|  }
   80|    214|  return nullptr;
   81|  7.04k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   150M|  bool IsInBottomLeft(const Point2& p) const {
   93|   150M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 150M, False: 245k]
  |  Branch (93:22): [True: 149M, False: 50.5k]
  ------------------
   94|   149M|      return true;
   95|   149M|    }
   96|   296k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 138k, False: 158k]
  |  Branch (96:25): [True: 65.8k, False: 72.5k]
  ------------------
   97|   150M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   150M|  int32_t GetRotationCount(Point2 pred) const {
   51|   150M|    const DataType sign_x = pred[0];
   52|   150M|    const DataType sign_y = pred[1];
   53|       |
   54|   150M|    int32_t rotation_count = 0;
   55|   150M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 150M, False: 245k]
  ------------------
   56|   150M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 149M, False: 50.5k]
  ------------------
   57|   149M|        rotation_count = 0;
   58|   149M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 46.8k, False: 3.69k]
  ------------------
   59|  46.8k|        rotation_count = 3;
   60|  46.8k|      } else {
   61|  3.69k|        rotation_count = 1;
   62|  3.69k|      }
   63|   150M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 107k, False: 138k]
  ------------------
   64|   107k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 64.0k, False: 43.4k]
  ------------------
   65|  64.0k|        rotation_count = 2;
   66|  64.0k|      } else {
   67|  43.4k|        rotation_count = 1;
   68|  43.4k|      }
   69|   138k|    } else {
   70|   138k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 65.8k, False: 72.5k]
  ------------------
   71|  65.8k|        rotation_count = 0;
   72|  72.5k|      } else {
   73|  72.5k|        rotation_count = 3;
   74|  72.5k|      }
   75|   138k|    }
   76|   150M|    return rotation_count;
   77|   150M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   461k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   461k|    switch (rotation_count) {
   81|   166k|      case 1:
  ------------------
  |  Branch (81:7): [True: 166k, False: 294k]
  ------------------
   82|   166k|        return Point2(p[1], -p[0]);
   83|   128k|      case 2:
  ------------------
  |  Branch (83:7): [True: 128k, False: 333k]
  ------------------
   84|   128k|        return Point2(-p[0], -p[1]);
   85|   166k|      case 3:
  ------------------
  |  Branch (85:7): [True: 166k, False: 294k]
  ------------------
   86|   166k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 461k]
  ------------------
   88|      0|        return p;
   89|   461k|    }
   90|   461k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    609|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  24.9k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  24.9k|                                      int attribute_id) {
   24|  24.9k|  decoder_ = decoder;
   25|  24.9k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  24.9k|  attribute_id_ = attribute_id;
   27|  24.9k|  return true;
   28|  24.9k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  14.6k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   39|  14.6k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 14.6k]
  ------------------
   40|  14.6k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 14.6k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  14.6k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 2.92k, False: 11.7k]
  ------------------
   44|  2.92k|    return false;
   45|  2.92k|  }
   46|  11.7k|  return true;
   47|  14.6k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  5.02k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  5.02k|  return true;
   53|  5.02k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    489|    const std::vector<PointIndex>& point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    489|  return true;
   59|    489|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  9.92k|const PointAttribute* SequentialAttributeDecoder::GetPortableAttribute() {
   62|       |  // If needed, copy point to attribute value index mapping from the final
   63|       |  // attribute to the portable attribute.
   64|  9.92k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 8.43k, False: 1.49k]
  |  Branch (64:45): [True: 7.99k, False: 442]
  ------------------
   65|  7.99k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 5.91k, False: 2.08k]
  ------------------
   66|  5.91k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  5.91k|    for (PointIndex i(0);
   68|  38.5M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 38.5M, False: 5.91k]
  ------------------
   69|  38.5M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  38.5M|    }
   71|  5.91k|  }
   72|  9.92k|  return portable_attribute_.get();
   73|  9.92k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  8.21k|    PredictionSchemeInterface* ps) {
   77|  11.3k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 3.17k, False: 8.18k]
  ------------------
   78|  3.17k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  3.17k|        ps->GetParentAttributeType(i));
   80|  3.17k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 5, False: 3.17k]
  ------------------
   81|      5|      return false;  // Requested attribute does not exist.
   82|      5|    }
   83|  3.17k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  3.17k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.17k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 3.17k]
  ------------------
   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|  3.17k|#endif
   90|  3.17k|    {
   91|  3.17k|      const PointAttribute* const pa = decoder_->GetPortableAttribute(att_id);
   92|  3.17k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 6, False: 3.16k]
  |  Branch (92:28): [True: 17, False: 3.15k]
  ------------------
   93|     23|        return false;
   94|     23|      }
   95|  3.17k|    }
   96|  3.17k|  }
   97|  8.18k|  return true;
   98|  8.21k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|  1.42k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
  102|  1.42k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|  1.42k|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|  1.42k|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|  1.42k|  uint8_t* const value_data = value_data_ptr.get();
  106|  1.42k|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|  8.64k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 7.35k, False: 1.28k]
  ------------------
  109|  7.35k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 134, False: 7.21k]
  ------------------
  110|    134|      return false;
  111|    134|    }
  112|  7.21k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|  7.21k|    out_byte_pos += entry_size;
  114|  7.21k|  }
  115|  1.28k|  return true;
  116|  1.42k|}

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  11.5k|  const PointAttribute* attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|   504M|  PointAttribute* attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  8.21k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  37.9k|  PointCloudDecoder* decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  12.6k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  12.6k|    portable_attribute_ = std::move(att);
   71|  12.6k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  42.4k|  PointAttribute* portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  24.9k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  36.5k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  7.32k|    DecoderBuffer* buffer) {
   30|  7.32k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 346, False: 6.98k]
  ------------------
   31|    346|    return false;
   32|    346|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  6.98k|  const int32_t num_attributes = GetNumAttributes();
   35|  6.98k|  sequential_decoders_.resize(num_attributes);
   36|  31.9k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 24.9k, False: 6.94k]
  ------------------
   37|  24.9k|    uint8_t decoder_type;
   38|  24.9k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 18, False: 24.9k]
  ------------------
   39|     18|      return false;
   40|     18|    }
   41|       |    // Create the decoder from the id.
   42|  24.9k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  24.9k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 11, False: 24.9k]
  ------------------
   44|     11|      return false;
   45|     11|    }
   46|  24.9k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 9, False: 24.9k]
  ------------------
   47|      9|      return false;
   48|      9|    }
   49|  24.9k|  }
   50|  6.94k|  return true;
   51|  6.98k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  6.49k|    DecoderBuffer* buffer) {
   55|  6.49k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 6.49k]
  |  Branch (55:22): [True: 4, False: 6.48k]
  ------------------
   56|      4|    return false;
   57|      4|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  6.48k|  const int32_t num_attributes = GetNumAttributes();
   60|  30.6k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 24.2k, False: 6.48k]
  ------------------
   61|  24.2k|    PointAttribute* const pa =
   62|  24.2k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  24.2k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 1, False: 24.2k]
  ------------------
   64|      1|      return false;
   65|      1|    }
   66|  24.2k|  }
   67|  6.48k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  6.48k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  6.48k|    DecoderBuffer* in_buffer) {
   72|  6.48k|  const int32_t num_attributes = GetNumAttributes();
   73|  18.1k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 14.6k, False: 3.56k]
  ------------------
   74|  14.6k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.92k, False: 11.7k]
  ------------------
   75|  14.6k|                                                          in_buffer)) {
   76|  2.92k|      return false;
   77|  2.92k|    }
   78|  14.6k|  }
   79|  3.56k|  return true;
   80|  6.48k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  3.56k|    DecodeDataNeededByPortableTransforms(DecoderBuffer* in_buffer) {
   84|  3.56k|  const int32_t num_attributes = GetNumAttributes();
   85|  9.18k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 6.17k, False: 3.00k]
  ------------------
   86|  6.17k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 558, False: 5.62k]
  ------------------
   87|  6.17k|            point_ids_, in_buffer)) {
   88|    558|      return false;
   89|    558|    }
   90|  6.17k|  }
   91|  3.00k|  return true;
   92|  3.56k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  3.00k|    TransformAttributesToOriginalFormat() {
   96|  3.00k|  const int32_t num_attributes = GetNumAttributes();
   97|  7.50k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 5.03k, False: 2.47k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  5.03k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 5.03k, False: 0]
  ------------------
  100|  5.03k|      const PointAttribute* const attribute =
  101|  5.03k|          sequential_decoders_[i]->attribute();
  102|  5.03k|      const PointAttribute* const portable_attribute =
  103|  5.03k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  5.03k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 4.54k, False: 489]
  |  Branch (104:11): [True: 1.47k, False: 3.56k]
  ------------------
  105|  4.54k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 1.47k, False: 3.07k]
  ------------------
  106|  4.54k|              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|  1.47k|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|  1.47k|        continue;
  114|  1.47k|      }
  115|  5.03k|    }
  116|  3.56k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 535, False: 3.03k]
  ------------------
  117|  3.56k|            point_ids_)) {
  118|    535|      return false;
  119|    535|    }
  120|  3.56k|  }
  121|  2.47k|  return true;
  122|  3.00k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  24.9k|    uint8_t decoder_type) {
  127|  24.9k|  switch (decoder_type) {
  128|  3.31k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 3.31k, False: 21.6k]
  ------------------
  129|  3.31k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  3.31k|          new SequentialAttributeDecoder());
  131|  20.1k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 20.1k, False: 4.84k]
  ------------------
  132|  20.1k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  20.1k|          new SequentialIntegerAttributeDecoder());
  134|    298|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 298, False: 24.6k]
  ------------------
  135|    298|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    298|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.22k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.22k, False: 23.7k]
  ------------------
  139|  1.22k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.22k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     11|    default:
  ------------------
  |  Branch (142:5): [True: 11, False: 24.9k]
  ------------------
  143|     11|      break;
  144|  24.9k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     11|  return nullptr;
  147|  24.9k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  21.6k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() =
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   27|  21.6k|                                             int attribute_id) {
   28|  21.6k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (28:7): [True: 0, False: 21.6k]
  ------------------
   29|      0|    return false;
   30|      0|  }
   31|  21.6k|  return true;
   32|  21.6k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   35|  3.07k|    const std::vector<PointIndex>& point_ids) {
   36|  3.07k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   37|  3.07k|  if (decoder() &&
  ------------------
  |  Branch (37:7): [True: 3.07k, False: 0]
  ------------------
   38|  3.07k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.07k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (38:7): [True: 0, False: 3.07k]
  ------------------
   39|      0|    return true;  // Don't revert the transform here for older files.
   40|      0|  }
   41|  3.07k|#endif
   42|  3.07k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   43|  3.07k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   46|  13.2k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   47|       |  // Decode prediction scheme.
   48|  13.2k|  int8_t prediction_scheme_method;
   49|  13.2k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (49:7): [True: 83, False: 13.1k]
  ------------------
   50|     83|    return false;
   51|     83|  }
   52|       |  // Check that decoded prediction scheme method type is valid.
   53|  13.1k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (53:7): [True: 72, False: 13.0k]
  ------------------
   54|  13.0k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (54:7): [True: 172, False: 12.8k]
  ------------------
   55|    244|    return false;
   56|    244|  }
   57|  12.8k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (57:7): [True: 12.8k, False: 9]
  ------------------
   58|  12.8k|    int8_t prediction_transform_type;
   59|  12.8k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (59:9): [True: 34, False: 12.8k]
  ------------------
   60|     34|      return false;
   61|     34|    }
   62|       |    // Check that decoded prediction scheme transform type is valid.
   63|  12.8k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (63:9): [True: 28, False: 12.8k]
  ------------------
   64|  12.8k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (64:9): [True: 117, False: 12.6k]
  ------------------
   65|    145|      return false;
   66|    145|    }
   67|  12.6k|    prediction_scheme_ = CreateIntPredictionScheme(
   68|  12.6k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   69|  12.6k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   70|  12.6k|  }
   71|       |
   72|  12.7k|  if (prediction_scheme_) {
  ------------------
  |  Branch (72:7): [True: 8.21k, False: 4.49k]
  ------------------
   73|  8.21k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (73:9): [True: 28, False: 8.18k]
  ------------------
   74|     28|      return false;
   75|     28|    }
   76|  8.21k|  }
   77|       |
   78|  12.6k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (78:7): [True: 2.25k, False: 10.4k]
  ------------------
   79|  2.25k|    return false;
   80|  2.25k|  }
   81|       |
   82|  10.4k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   83|  10.4k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   84|  10.4k|  if (decoder() &&
  ------------------
  |  Branch (84:7): [True: 10.4k, False: 0]
  ------------------
   85|  10.4k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  10.4k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (85:7): [True: 0, False: 10.4k]
  ------------------
   86|       |    // For older files, revert the transform right after we decode the data.
   87|      0|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (87:9): [True: 0, False: 0]
  ------------------
   88|      0|      return false;
   89|      0|    }
   90|      0|  }
   91|  10.4k|#endif
   92|  10.4k|  return true;
   93|  10.4k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   98|  11.5k|    PredictionSchemeTransformType transform_type) {
   99|  11.5k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (99:7): [True: 4.44k, False: 7.08k]
  ------------------
  100|  4.44k|    return nullptr;  // For now we support only wrap transform.
  101|  4.44k|  }
  102|  7.08k|  return CreatePredictionSchemeForDecoder<
  103|  7.08k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  104|  7.08k|      method, attribute_id(), decoder());
  105|  11.5k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  108|  12.6k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
  109|  12.6k|  const int num_components = GetNumValueComponents();
  110|  12.6k|  if (num_components <= 0) {
  ------------------
  |  Branch (110:7): [True: 0, False: 12.6k]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|  12.6k|  const size_t num_entries = point_ids.size();
  114|  12.6k|  const size_t num_values = num_entries * num_components;
  115|  12.6k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  116|  12.6k|  int32_t* const portable_attribute_data = GetPortableAttributeData();
  117|  12.6k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (117:7): [True: 10, False: 12.6k]
  ------------------
  118|     10|    return false;
  119|     10|  }
  120|  12.6k|  uint8_t compressed;
  121|  12.6k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (121:7): [True: 49, False: 12.6k]
  ------------------
  122|     49|    return false;
  123|     49|  }
  124|  12.6k|  if (compressed > 0) {
  ------------------
  |  Branch (124:7): [True: 778, False: 11.8k]
  ------------------
  125|       |    // Decode compressed values.
  126|    778|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (126:9): [True: 276, False: 502]
  ------------------
  127|    778|                       in_buffer,
  128|    778|                       reinterpret_cast<uint32_t*>(portable_attribute_data))) {
  129|    276|      return false;
  130|    276|    }
  131|  11.8k|  } else {
  132|       |    // Decode the integer data directly.
  133|       |    // Get the number of bytes for a given entry.
  134|  11.8k|    uint8_t num_bytes;
  135|  11.8k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (135:9): [True: 33, False: 11.8k]
  ------------------
  136|     33|      return false;
  137|     33|    }
  138|  11.8k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (138:9): [True: 652, False: 11.1k]
  ------------------
  139|    652|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (139:11): [True: 0, False: 652]
  ------------------
  140|    652|          sizeof(int32_t) * num_values) {
  141|      0|        return false;
  142|      0|      }
  143|    652|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (143:11): [True: 10, False: 642]
  ------------------
  144|    652|                             sizeof(int32_t) * num_values)) {
  145|     10|        return false;
  146|     10|      }
  147|  11.1k|    } else {
  148|  11.1k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (148:11): [True: 48, False: 11.1k]
  ------------------
  149|  11.1k|          num_bytes * num_values) {
  150|     48|        return false;
  151|     48|      }
  152|  11.1k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (152:11): [True: 34, False: 11.0k]
  ------------------
  153|  11.1k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  154|     34|        return false;
  155|     34|      }
  156|  2.91G|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (156:26): [True: 2.91G, False: 11.0k]
  ------------------
  157|  2.91G|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (157:13): [True: 0, False: 2.91G]
  ------------------
  158|      0|          return false;
  159|      0|        }
  160|  2.91G|      }
  161|  11.0k|    }
  162|  11.8k|  }
  163|       |
  164|  12.2k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (164:7): [True: 12.2k, False: 0]
  |  Branch (164:26): [True: 4.28k, False: 7.92k]
  ------------------
  165|  11.1k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (165:26): [True: 6.84k, False: 1.08k]
  ------------------
  166|       |    // Convert the values back to the original signed format.
  167|  11.1k|    ConvertSymbolsToSignedInts(
  168|  11.1k|        reinterpret_cast<const uint32_t*>(portable_attribute_data),
  169|  11.1k|        static_cast<int>(num_values), portable_attribute_data);
  170|  11.1k|  }
  171|       |
  172|       |  // If the data was encoded with a prediction scheme, we must revert it.
  173|  12.2k|  if (prediction_scheme_) {
  ------------------
  |  Branch (173:7): [True: 7.92k, False: 4.28k]
  ------------------
  174|  7.92k|    prediction_scheme_->SetMaxNumPredictedValues(num_values);
  175|  7.92k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (175:9): [True: 985, False: 6.94k]
  ------------------
  176|    985|      return false;
  177|    985|    }
  178|       |
  179|  6.94k|    if (num_values > 0) {
  ------------------
  |  Branch (179:9): [True: 6.94k, False: 0]
  ------------------
  180|  6.94k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (180:11): [True: 809, False: 6.13k]
  ------------------
  181|  6.94k|              portable_attribute_data, portable_attribute_data,
  182|  6.94k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  183|    809|        return false;
  184|    809|      }
  185|  6.94k|    }
  186|  6.94k|  }
  187|  10.4k|  return true;
  188|  12.2k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  190|  2.51k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  191|  2.51k|  switch (attribute()->data_type()) {
  192|    251|    case DT_UINT8:
  ------------------
  |  Branch (192:5): [True: 251, False: 2.26k]
  ------------------
  193|    251|      StoreTypedValues<uint8_t>(num_values);
  194|    251|      break;
  195|  1.29k|    case DT_INT8:
  ------------------
  |  Branch (195:5): [True: 1.29k, False: 1.22k]
  ------------------
  196|  1.29k|      StoreTypedValues<int8_t>(num_values);
  197|  1.29k|      break;
  198|    145|    case DT_UINT16:
  ------------------
  |  Branch (198:5): [True: 145, False: 2.37k]
  ------------------
  199|    145|      StoreTypedValues<uint16_t>(num_values);
  200|    145|      break;
  201|    230|    case DT_INT16:
  ------------------
  |  Branch (201:5): [True: 230, False: 2.28k]
  ------------------
  202|    230|      StoreTypedValues<int16_t>(num_values);
  203|    230|      break;
  204|    245|    case DT_UINT32:
  ------------------
  |  Branch (204:5): [True: 245, False: 2.27k]
  ------------------
  205|    245|      StoreTypedValues<uint32_t>(num_values);
  206|    245|      break;
  207|    174|    case DT_INT32:
  ------------------
  |  Branch (207:5): [True: 174, False: 2.34k]
  ------------------
  208|    174|      StoreTypedValues<int32_t>(num_values);
  209|    174|      break;
  210|    178|    default:
  ------------------
  |  Branch (210:5): [True: 178, False: 2.33k]
  ------------------
  211|    178|      return false;
  212|  2.51k|  }
  213|  2.33k|  return true;
  214|  2.51k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  238|  12.6k|    int num_entries, int num_components) {
  239|  12.6k|  GeometryAttribute ga;
  240|  12.6k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  241|  12.6k|          false, num_components * DataTypeLength(DT_INT32), 0);
  242|  12.6k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  243|  12.6k|  port_att->SetIdentityMapping();
  244|  12.6k|  port_att->Reset(num_entries);
  245|  12.6k|  port_att->set_unique_id(attribute()->unique_id());
  246|  12.6k|  SetPortableAttribute(std::move(port_att));
  247|  12.6k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  217|    251|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    251|  const int num_components = attribute()->num_components();
  219|    251|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    251|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    251|      new AttributeTypeT[num_components]);
  222|    251|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    251|  int val_id = 0;
  224|    251|  int out_byte_pos = 0;
  225|  87.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 87.6M, False: 251]
  ------------------
  226|   253M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 165M, False: 87.6M]
  ------------------
  227|   165M|      const AttributeTypeT value =
  228|   165M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   165M|      att_val[c] = value;
  230|   165M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  87.6M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  87.6M|    out_byte_pos += entry_size;
  234|  87.6M|  }
  235|    251|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  217|  1.29k|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|  1.29k|  const int num_components = attribute()->num_components();
  219|  1.29k|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|  1.29k|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|  1.29k|      new AttributeTypeT[num_components]);
  222|  1.29k|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|  1.29k|  int val_id = 0;
  224|  1.29k|  int out_byte_pos = 0;
  225|   386M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 386M, False: 1.29k]
  ------------------
  226|  1.29G|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 913M, False: 386M]
  ------------------
  227|   913M|      const AttributeTypeT value =
  228|   913M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   913M|      att_val[c] = value;
  230|   913M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   386M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   386M|    out_byte_pos += entry_size;
  234|   386M|  }
  235|  1.29k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  217|    145|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    145|  const int num_components = attribute()->num_components();
  219|    145|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    145|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    145|      new AttributeTypeT[num_components]);
  222|    145|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    145|  int val_id = 0;
  224|    145|  int out_byte_pos = 0;
  225|   750k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 750k, False: 145]
  ------------------
  226|  71.2M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 70.5M, False: 750k]
  ------------------
  227|  70.5M|      const AttributeTypeT value =
  228|  70.5M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  70.5M|      att_val[c] = value;
  230|  70.5M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   750k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   750k|    out_byte_pos += entry_size;
  234|   750k|  }
  235|    145|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  217|    230|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    230|  const int num_components = attribute()->num_components();
  219|    230|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    230|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    230|      new AttributeTypeT[num_components]);
  222|    230|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    230|  int val_id = 0;
  224|    230|  int out_byte_pos = 0;
  225|  17.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 17.6M, False: 230]
  ------------------
  226|  85.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 68.1M, False: 17.6M]
  ------------------
  227|  68.1M|      const AttributeTypeT value =
  228|  68.1M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  68.1M|      att_val[c] = value;
  230|  68.1M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  17.6M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  17.6M|    out_byte_pos += entry_size;
  234|  17.6M|  }
  235|    230|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  217|    245|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    245|  const int num_components = attribute()->num_components();
  219|    245|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    245|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    245|      new AttributeTypeT[num_components]);
  222|    245|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    245|  int val_id = 0;
  224|    245|  int out_byte_pos = 0;
  225|  1.16M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 1.16M, False: 245]
  ------------------
  226|  71.9M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 70.7M, False: 1.16M]
  ------------------
  227|  70.7M|      const AttributeTypeT value =
  228|  70.7M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  70.7M|      att_val[c] = value;
  230|  70.7M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  1.16M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  1.16M|    out_byte_pos += entry_size;
  234|  1.16M|  }
  235|    245|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  217|    174|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    174|  const int num_components = attribute()->num_components();
  219|    174|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    174|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    174|      new AttributeTypeT[num_components]);
  222|    174|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    174|  int val_id = 0;
  224|    174|  int out_byte_pos = 0;
  225|  11.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 11.1M, False: 174]
  ------------------
  226|  78.9M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 67.8M, False: 11.1M]
  ------------------
  227|  67.8M|      const AttributeTypeT value =
  228|  67.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  67.8M|      att_val[c] = value;
  230|  67.8M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  11.1M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  11.1M|    out_byte_pos += entry_size;
  234|  11.1M|  }
  235|    174|}

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  9.30M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t* value) {
   51|  9.30M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  9.30M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  9.30M|    const int remaining = 32 - num_used_bits_;
   54|  9.30M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 8.16M, False: 1.13M]
  ------------------
   55|  8.16M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 7.77M, False: 395k]
  ------------------
   56|  7.77M|        return false;
   57|  7.77M|      }
   58|   395k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   395k|      num_used_bits_ += nbits;
   60|   395k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 13.3k, False: 382k]
  ------------------
   61|  13.3k|        ++pos_;
   62|  13.3k|        num_used_bits_ = 0;
   63|  13.3k|      }
   64|  1.13M|    } else {
   65|  1.13M|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 1.12M, False: 14.1k]
  ------------------
   66|  1.12M|        return false;
   67|  1.12M|      }
   68|  14.1k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  14.1k|      num_used_bits_ = nbits - remaining;
   70|  14.1k|      ++pos_;
   71|  14.1k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  14.1k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  14.1k|    }
   74|   409k|    return true;
   75|  9.30M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  9.32M|  bool DecodeNextBit() {
   35|  9.32M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  9.32M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 8.92M, False: 392k]
  ------------------
   37|  8.92M|      return false;
   38|  8.92M|    }
   39|   392k|    const bool bit = *pos_ & selector;
   40|   392k|    ++num_used_bits_;
   41|   392k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 12.0k, False: 380k]
  ------------------
   42|  12.0k|      ++pos_;
   43|  12.0k|      num_used_bits_ = 0;
   44|  12.0k|    }
   45|   392k|    return bit;
   46|  9.32M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    807|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|  1.05k|  FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|  1.05k|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    589|  bool StartDecoding(DecoderBuffer* source_buffer) {
   34|  13.3k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 13.0k, False: 370]
  ------------------
   35|  13.0k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 219, False: 12.8k]
  ------------------
   36|    219|        return false;
   37|    219|      }
   38|  13.0k|    }
   39|    370|    return bit_decoder_.StartDecoding(source_buffer);
   40|    589|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  3.11M|  void DecodeLeastSignificantBits32(int nbits, uint32_t* value) {
   48|  3.11M|    uint32_t result = 0;
   49|  19.9M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 16.8M, False: 3.11M]
  ------------------
   50|  16.8M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  16.8M|      result = (result << 1) + bit;
   52|  16.8M|    }
   53|  3.11M|    *value = result;
   54|  3.11M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|    125|  void EndDecoding() {
   57|  4.12k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 4.00k, False: 125]
  ------------------
   58|  4.00k|      folded_number_decoders_[i].EndDecoding();
   59|  4.00k|    }
   60|    125|    bit_decoder_.EndDecoding();
   61|    125|  }

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  81.6k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  41.4k|                                const uint8_t* const buf, int offset) {
  301|  41.4k|  unsigned x;
  302|  41.4k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 97, False: 41.3k]
  ------------------
  303|     97|    return 1;
  304|     97|  }
  305|  41.3k|  ans->buf = buf;
  306|  41.3k|  x = buf[offset - 1] >> 6;
  307|  41.3k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 36.4k, False: 4.85k]
  ------------------
  308|  36.4k|    ans->buf_offset = offset - 1;
  309|  36.4k|    ans->state = buf[offset - 1] & 0x3F;
  310|  36.4k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 4.46k, False: 390]
  ------------------
  311|  4.46k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 9, False: 4.46k]
  ------------------
  312|      9|      return 1;
  313|      9|    }
  314|  4.46k|    ans->buf_offset = offset - 2;
  315|  4.46k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  4.46k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 366, False: 24]
  ------------------
  317|    366|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 4, False: 362]
  ------------------
  318|      4|      return 1;
  319|      4|    }
  320|    362|    ans->buf_offset = offset - 3;
  321|    362|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    362|  } else {
  323|     24|    return 1;
  324|     24|  }
  325|  41.2k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  41.2k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  41.2k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  41.2k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  41.2k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 20, False: 41.2k]
  ------------------
  327|     20|    return 1;
  328|     20|  }
  329|  41.2k|  return 0;
  330|  41.2k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  4.46k|static uint32_t mem_get_le16(const void* vmem) {
   68|  4.46k|  uint32_t val;
   69|  4.46k|  const uint8_t* mem = (const uint8_t*)vmem;
   70|       |
   71|  4.46k|  val = mem[1] << 8;
   72|  4.46k|  val |= mem[0];
   73|  4.46k|  return val;
   74|  4.46k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    362|static uint32_t mem_get_le24(const void* vmem) {
   77|    362|  uint32_t val;
   78|    362|  const uint8_t* mem = (const uint8_t*)vmem;
   79|       |
   80|    362|  val = mem[2] << 16;
   81|    362|  val |= mem[1] << 8;
   82|    362|  val |= mem[0];
   83|    362|  return val;
   84|    362|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|   143M|static inline int rabs_desc_read(struct AnsDecoder* ans, AnsP8 p0) {
  167|   143M|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|   143M|  unsigned quot, rem, x, xn;
  172|   143M|#endif
  173|   143M|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|   143M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|   143M|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|   286M|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 109M, False: 33.7M]
  |  Branch (174:40): [True: 102k, False: 109M]
  ------------------
  175|   102k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   102k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   102k|  }
  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|   143M|  x = ans->state;
  184|   143M|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   143M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|   143M|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   143M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|   143M|  xn = quot * p;
  187|   143M|  val = rem < p;
  188|   143M|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|   286M|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 115M, False: 27.7M]
  |  |  ------------------
  ------------------
  189|   115M|    ans->state = xn + rem;
  190|   115M|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  27.7M|    ans->state = x - xn - p;
  193|  27.7M|  }
  194|   143M|#endif
  195|   143M|  return val;
  196|   143M|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|   112k|static inline int ans_read_end(struct AnsDecoder* const ans) {
  333|   112k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|   112k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|   112k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  5.53k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  484|  2.97k|                                       uint32_t num_symbols) {
  485|  2.97k|    lut_table_.resize(rans_precision);
  486|  2.97k|    probability_table_.resize(num_symbols);
  487|  2.97k|    uint32_t cum_prob = 0;
  488|  2.97k|    uint32_t act_prob = 0;
  489|  24.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 22.1k, False: 2.74k]
  ------------------
  490|  22.1k|      probability_table_[i].prob = token_probs[i];
  491|  22.1k|      probability_table_[i].cum_prob = cum_prob;
  492|  22.1k|      cum_prob += token_probs[i];
  493|  22.1k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 230, False: 21.8k]
  ------------------
  494|    230|        return false;
  495|    230|      }
  496|  10.0M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 9.99M, False: 21.8k]
  ------------------
  497|  9.99M|        lut_table_[j] = i;
  498|  9.99M|      }
  499|  21.8k|      act_prob = cum_prob;
  500|  21.8k|    }
  501|  2.74k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 360, False: 2.38k]
  ------------------
  502|    360|      return false;
  503|    360|    }
  504|  2.38k|    return true;
  505|  2.74k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  2.20k|  inline int read_init(const uint8_t* const buf, int offset) {
  422|  2.20k|    unsigned x;
  423|  2.20k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 154, False: 2.05k]
  ------------------
  424|    154|      return 1;
  425|    154|    }
  426|  2.05k|    ans_.buf = buf;
  427|  2.05k|    x = buf[offset - 1] >> 6;
  428|  2.05k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1.32k, False: 732]
  ------------------
  429|  1.32k|      ans_.buf_offset = offset - 1;
  430|  1.32k|      ans_.state = buf[offset - 1] & 0x3F;
  431|  1.32k|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 291, False: 441]
  ------------------
  432|    291|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 36, False: 255]
  ------------------
  433|     36|        return 1;
  434|     36|      }
  435|    255|      ans_.buf_offset = offset - 2;
  436|    255|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    441|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 288, False: 153]
  ------------------
  438|    288|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 51, False: 237]
  ------------------
  439|     51|        return 1;
  440|     51|      }
  441|    237|      ans_.buf_offset = offset - 3;
  442|    237|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    237|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 153, False: 0]
  ------------------
  444|    153|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 33, False: 120]
  ------------------
  445|     33|        return 1;
  446|     33|      }
  447|    120|      ans_.buf_offset = offset - 4;
  448|    120|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|    120|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|  1.93k|    ans_.state += l_rans_base;
  453|  1.93k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.93k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 115, False: 1.81k]
  ------------------
  454|    115|      return 1;
  455|    115|    }
  456|  1.81k|    return 0;
  457|  1.93k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    411|static uint32_t mem_get_le16(const void* vmem) {
   68|    411|  uint32_t val;
   69|    411|  const uint8_t* mem = (const uint8_t*)vmem;
   70|       |
   71|    411|  val = mem[1] << 8;
   72|    411|  val |= mem[0];
   73|    411|  return val;
   74|    411|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    392|static uint32_t mem_get_le24(const void* vmem) {
   77|    392|  uint32_t val;
   78|    392|  const uint8_t* mem = (const uint8_t*)vmem;
   79|       |
   80|    392|  val = mem[2] << 16;
   81|    392|  val |= mem[1] << 8;
   82|    392|  val |= mem[0];
   83|    392|  return val;
   84|    392|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    435|static inline uint32_t mem_get_le32(const void* vmem) {
   87|    435|  uint32_t val;
   88|    435|  const uint8_t* mem = (const uint8_t*)vmem;
   89|       |
   90|    435|  val = mem[3] << 24;
   91|    435|  val |= mem[2] << 16;
   92|    435|  val |= mem[1] << 8;
   93|    435|  val |= mem[0];
   94|    435|  return val;
   95|    435|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  465|   114M|  inline int rans_read() {
  466|   114M|    unsigned rem;
  467|   114M|    unsigned quo;
  468|   114M|    struct rans_dec_sym sym;
  469|   114M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 101M, False: 13.0M]
  |  Branch (469:40): [True: 26.3k, False: 101M]
  ------------------
  470|  26.3k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  26.3k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  26.3k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   114M|    quo = ans_.state / rans_precision;
  475|   114M|    rem = ans_.state % rans_precision;
  476|   114M|    fetch_sym(&sym, rem);
  477|   114M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   114M|    return sym.val;
  479|   114M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  508|   114M|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   114M|    uint32_t symbol = lut_table_[rem];
  510|   114M|    out->val = symbol;
  511|   114M|    out->prob = probability_table_[symbol].prob;
  512|   114M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   114M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  459|  1.71k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    413|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  484|    250|                                       uint32_t num_symbols) {
  485|    250|    lut_table_.resize(rans_precision);
  486|    250|    probability_table_.resize(num_symbols);
  487|    250|    uint32_t cum_prob = 0;
  488|    250|    uint32_t act_prob = 0;
  489|  9.08k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 8.87k, False: 207]
  ------------------
  490|  8.87k|      probability_table_[i].prob = token_probs[i];
  491|  8.87k|      probability_table_[i].cum_prob = cum_prob;
  492|  8.87k|      cum_prob += token_probs[i];
  493|  8.87k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 43, False: 8.83k]
  ------------------
  494|     43|        return false;
  495|     43|      }
  496|  1.43M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 1.42M, False: 8.83k]
  ------------------
  497|  1.42M|        lut_table_[j] = i;
  498|  1.42M|      }
  499|  8.83k|      act_prob = cum_prob;
  500|  8.83k|    }
  501|    207|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 58, False: 149]
  ------------------
  502|     58|      return false;
  503|     58|    }
  504|    149|    return true;
  505|    207|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|    111|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    111|    unsigned x;
  423|    111|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 108]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|    108|    ans_.buf = buf;
  427|    108|    x = buf[offset - 1] >> 6;
  428|    108|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 46, False: 62]
  ------------------
  429|     46|      ans_.buf_offset = offset - 1;
  430|     46|      ans_.state = buf[offset - 1] & 0x3F;
  431|     62|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 15, False: 47]
  ------------------
  432|     15|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 3, False: 12]
  ------------------
  433|      3|        return 1;
  434|      3|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     47|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 27, False: 20]
  ------------------
  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|     20|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 20, False: 0]
  ------------------
  444|     20|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 1, False: 19]
  ------------------
  445|      1|        return 1;
  446|      1|      }
  447|     19|      ans_.buf_offset = offset - 4;
  448|     19|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     19|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     93|    ans_.state += l_rans_base;
  453|     93|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     93|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 15, False: 78]
  ------------------
  454|     15|      return 1;
  455|     15|    }
  456|     78|    return 0;
  457|     93|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  465|   161k|  inline int rans_read() {
  466|   161k|    unsigned rem;
  467|   161k|    unsigned quo;
  468|   161k|    struct rans_dec_sym sym;
  469|   162k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 58.9k, False: 103k]
  |  Branch (469:40): [True: 1.29k, False: 57.6k]
  ------------------
  470|  1.29k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.29k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.29k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   161k|    quo = ans_.state / rans_precision;
  475|   161k|    rem = ans_.state % rans_precision;
  476|   161k|    fetch_sym(&sym, rem);
  477|   161k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   161k|    return sym.val;
  479|   161k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  508|   161k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   161k|    uint32_t symbol = lut_table_[rem];
  510|   161k|    out->val = symbol;
  511|   161k|    out->prob = probability_table_[symbol].prob;
  512|   161k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   161k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  459|     78|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    467|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  484|    286|                                       uint32_t num_symbols) {
  485|    286|    lut_table_.resize(rans_precision);
  486|    286|    probability_table_.resize(num_symbols);
  487|    286|    uint32_t cum_prob = 0;
  488|    286|    uint32_t act_prob = 0;
  489|  5.18k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 4.92k, False: 263]
  ------------------
  490|  4.92k|      probability_table_[i].prob = token_probs[i];
  491|  4.92k|      probability_table_[i].cum_prob = cum_prob;
  492|  4.92k|      cum_prob += token_probs[i];
  493|  4.92k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 23, False: 4.90k]
  ------------------
  494|     23|        return false;
  495|     23|      }
  496|  7.27M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 7.26M, False: 4.90k]
  ------------------
  497|  7.26M|        lut_table_[j] = i;
  498|  7.26M|      }
  499|  4.90k|      act_prob = cum_prob;
  500|  4.90k|    }
  501|    263|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 53, False: 210]
  ------------------
  502|     53|      return false;
  503|     53|    }
  504|    210|    return true;
  505|    263|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|    114|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    114|    unsigned x;
  423|    114|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 108]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|    108|    ans_.buf = buf;
  427|    108|    x = buf[offset - 1] >> 6;
  428|    108|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 41, False: 67]
  ------------------
  429|     41|      ans_.buf_offset = offset - 1;
  430|     41|      ans_.state = buf[offset - 1] & 0x3F;
  431|     67|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 25, False: 42]
  ------------------
  432|     25|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 6, False: 19]
  ------------------
  433|      6|        return 1;
  434|      6|      }
  435|     19|      ans_.buf_offset = offset - 2;
  436|     19|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     42|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 24, False: 18]
  ------------------
  438|     24|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 2, False: 22]
  ------------------
  439|      2|        return 1;
  440|      2|      }
  441|     22|      ans_.buf_offset = offset - 3;
  442|     22|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     22|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 18, False: 0]
  ------------------
  444|     18|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 3, False: 15]
  ------------------
  445|      3|        return 1;
  446|      3|      }
  447|     15|      ans_.buf_offset = offset - 4;
  448|     15|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     15|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     97|    ans_.state += l_rans_base;
  453|     97|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     97|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 12, False: 85]
  ------------------
  454|     12|      return 1;
  455|     12|    }
  456|     85|    return 0;
  457|     97|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  465|   671k|  inline int rans_read() {
  466|   671k|    unsigned rem;
  467|   671k|    unsigned quo;
  468|   671k|    struct rans_dec_sym sym;
  469|   673k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 660k, False: 12.3k]
  |  Branch (469:40): [True: 1.68k, False: 659k]
  ------------------
  470|  1.68k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.68k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.68k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   671k|    quo = ans_.state / rans_precision;
  475|   671k|    rem = ans_.state % rans_precision;
  476|   671k|    fetch_sym(&sym, rem);
  477|   671k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   671k|    return sym.val;
  479|   671k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  508|   671k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   671k|    uint32_t symbol = lut_table_[rem];
  510|   671k|    out->val = symbol;
  511|   671k|    out->prob = probability_table_[symbol].prob;
  512|   671k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   671k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  459|     85|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    532|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  484|    338|                                       uint32_t num_symbols) {
  485|    338|    lut_table_.resize(rans_precision);
  486|    338|    probability_table_.resize(num_symbols);
  487|    338|    uint32_t cum_prob = 0;
  488|    338|    uint32_t act_prob = 0;
  489|  13.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 13.5k, False: 293]
  ------------------
  490|  13.5k|      probability_table_[i].prob = token_probs[i];
  491|  13.5k|      probability_table_[i].cum_prob = cum_prob;
  492|  13.5k|      cum_prob += token_probs[i];
  493|  13.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 45, False: 13.4k]
  ------------------
  494|     45|        return false;
  495|     45|      }
  496|  16.9M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 16.9M, False: 13.4k]
  ------------------
  497|  16.9M|        lut_table_[j] = i;
  498|  16.9M|      }
  499|  13.4k|      act_prob = cum_prob;
  500|  13.4k|    }
  501|    293|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 67, False: 226]
  ------------------
  502|     67|      return false;
  503|     67|    }
  504|    226|    return true;
  505|    293|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|    118|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    118|    unsigned x;
  423|    118|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 115]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|    115|    ans_.buf = buf;
  427|    115|    x = buf[offset - 1] >> 6;
  428|    115|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 36, False: 79]
  ------------------
  429|     36|      ans_.buf_offset = offset - 1;
  430|     36|      ans_.state = buf[offset - 1] & 0x3F;
  431|     79|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 26, False: 53]
  ------------------
  432|     26|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 16]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|     16|      ans_.buf_offset = offset - 2;
  436|     16|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     53|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 22, False: 31]
  ------------------
  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|     31|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 31, False: 0]
  ------------------
  444|     31|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 4, False: 27]
  ------------------
  445|      4|        return 1;
  446|      4|      }
  447|     27|      ans_.buf_offset = offset - 4;
  448|     27|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     27|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     83|    ans_.state += l_rans_base;
  453|     83|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     83|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 21, False: 62]
  ------------------
  454|     21|      return 1;
  455|     21|    }
  456|     62|    return 0;
  457|     83|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  465|  37.4k|  inline int rans_read() {
  466|  37.4k|    unsigned rem;
  467|  37.4k|    unsigned quo;
  468|  37.4k|    struct rans_dec_sym sym;
  469|  38.0k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 35.3k, False: 2.60k]
  |  Branch (469:40): [True: 523, False: 34.8k]
  ------------------
  470|    523|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    523|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    523|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|  37.4k|    quo = ans_.state / rans_precision;
  475|  37.4k|    rem = ans_.state % rans_precision;
  476|  37.4k|    fetch_sym(&sym, rem);
  477|  37.4k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|  37.4k|    return sym.val;
  479|  37.4k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  508|  37.4k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|  37.4k|    uint32_t symbol = lut_table_[rem];
  510|  37.4k|    out->val = symbol;
  511|  37.4k|    out->prob = probability_table_[symbol].prob;
  512|  37.4k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|  37.4k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  459|     62|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    536|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  484|    329|                                       uint32_t num_symbols) {
  485|    329|    lut_table_.resize(rans_precision);
  486|    329|    probability_table_.resize(num_symbols);
  487|    329|    uint32_t cum_prob = 0;
  488|    329|    uint32_t act_prob = 0;
  489|  5.51k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 5.22k, False: 291]
  ------------------
  490|  5.22k|      probability_table_[i].prob = token_probs[i];
  491|  5.22k|      probability_table_[i].cum_prob = cum_prob;
  492|  5.22k|      cum_prob += token_probs[i];
  493|  5.22k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 38, False: 5.18k]
  ------------------
  494|     38|        return false;
  495|     38|      }
  496|  59.8M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 59.8M, False: 5.18k]
  ------------------
  497|  59.8M|        lut_table_[j] = i;
  498|  59.8M|      }
  499|  5.18k|      act_prob = cum_prob;
  500|  5.18k|    }
  501|    291|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 79, False: 212]
  ------------------
  502|     79|      return false;
  503|     79|    }
  504|    212|    return true;
  505|    291|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|    124|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    124|    unsigned x;
  423|    124|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 118]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|    118|    ans_.buf = buf;
  427|    118|    x = buf[offset - 1] >> 6;
  428|    118|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 35, False: 83]
  ------------------
  429|     35|      ans_.buf_offset = offset - 1;
  430|     35|      ans_.state = buf[offset - 1] & 0x3F;
  431|     83|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 10, False: 73]
  ------------------
  432|     10|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 3, False: 7]
  ------------------
  433|      3|        return 1;
  434|      3|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     73|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 27, False: 46]
  ------------------
  438|     27|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 10, False: 17]
  ------------------
  439|     10|        return 1;
  440|     10|      }
  441|     17|      ans_.buf_offset = offset - 3;
  442|     17|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     46|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 46, False: 0]
  ------------------
  444|     46|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 15, False: 31]
  ------------------
  445|     15|        return 1;
  446|     15|      }
  447|     31|      ans_.buf_offset = offset - 4;
  448|     31|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     31|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     90|    ans_.state += l_rans_base;
  453|     90|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     90|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 13, False: 77]
  ------------------
  454|     13|      return 1;
  455|     13|    }
  456|     77|    return 0;
  457|     90|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  465|   359k|  inline int rans_read() {
  466|   359k|    unsigned rem;
  467|   359k|    unsigned quo;
  468|   359k|    struct rans_dec_sym sym;
  469|   360k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 296k, False: 63.6k]
  |  Branch (469:40): [True: 758, False: 295k]
  ------------------
  470|    758|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    758|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    758|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   359k|    quo = ans_.state / rans_precision;
  475|   359k|    rem = ans_.state % rans_precision;
  476|   359k|    fetch_sym(&sym, rem);
  477|   359k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   359k|    return sym.val;
  479|   359k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  508|   359k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   359k|    uint32_t symbol = lut_table_[rem];
  510|   359k|    out->val = symbol;
  511|   359k|    out->prob = probability_table_[symbol].prob;
  512|   359k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   359k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  459|     77|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    602|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  484|    387|                                       uint32_t num_symbols) {
  485|    387|    lut_table_.resize(rans_precision);
  486|    387|    probability_table_.resize(num_symbols);
  487|    387|    uint32_t cum_prob = 0;
  488|    387|    uint32_t act_prob = 0;
  489|  4.62k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 4.26k, False: 361]
  ------------------
  490|  4.26k|      probability_table_[i].prob = token_probs[i];
  491|  4.26k|      probability_table_[i].cum_prob = cum_prob;
  492|  4.26k|      cum_prob += token_probs[i];
  493|  4.26k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 26, False: 4.23k]
  ------------------
  494|     26|        return false;
  495|     26|      }
  496|   150M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 150M, False: 4.23k]
  ------------------
  497|   150M|        lut_table_[j] = i;
  498|   150M|      }
  499|  4.23k|      act_prob = cum_prob;
  500|  4.23k|    }
  501|    361|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 101, False: 260]
  ------------------
  502|    101|      return false;
  503|    101|    }
  504|    260|    return true;
  505|    361|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|    141|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    141|    unsigned x;
  423|    141|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 18, False: 123]
  ------------------
  424|     18|      return 1;
  425|     18|    }
  426|    123|    ans_.buf = buf;
  427|    123|    x = buf[offset - 1] >> 6;
  428|    123|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 43, False: 80]
  ------------------
  429|     43|      ans_.buf_offset = offset - 1;
  430|     43|      ans_.state = buf[offset - 1] & 0x3F;
  431|     80|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 17, False: 63]
  ------------------
  432|     17|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 3, False: 14]
  ------------------
  433|      3|        return 1;
  434|      3|      }
  435|     14|      ans_.buf_offset = offset - 2;
  436|     14|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     63|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 14, False: 49]
  ------------------
  438|     14|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 13]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|     13|      ans_.buf_offset = offset - 3;
  442|     13|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     49|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 49, False: 0]
  ------------------
  444|     49|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 2, False: 47]
  ------------------
  445|      2|        return 1;
  446|      2|      }
  447|     47|      ans_.buf_offset = offset - 4;
  448|     47|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     47|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    117|    ans_.state += l_rans_base;
  453|    117|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    117|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 25, False: 92]
  ------------------
  454|     25|      return 1;
  455|     25|    }
  456|     92|    return 0;
  457|    117|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  465|   732k|  inline int rans_read() {
  466|   732k|    unsigned rem;
  467|   732k|    unsigned quo;
  468|   732k|    struct rans_dec_sym sym;
  469|   733k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 553k, False: 180k]
  |  Branch (469:40): [True: 1.25k, False: 552k]
  ------------------
  470|  1.25k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.25k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.25k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   732k|    quo = ans_.state / rans_precision;
  475|   732k|    rem = ans_.state % rans_precision;
  476|   732k|    fetch_sym(&sym, rem);
  477|   732k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   732k|    return sym.val;
  479|   732k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  508|   732k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   732k|    uint32_t symbol = lut_table_[rem];
  510|   732k|    out->val = symbol;
  511|   732k|    out->prob = probability_table_[symbol].prob;
  512|   732k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   732k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  459|     92|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  2.56k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  484|  1.48k|                                       uint32_t num_symbols) {
  485|  1.48k|    lut_table_.resize(rans_precision);
  486|  1.48k|    probability_table_.resize(num_symbols);
  487|  1.48k|    uint32_t cum_prob = 0;
  488|  1.48k|    uint32_t act_prob = 0;
  489|  30.1k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 28.7k, False: 1.42k]
  ------------------
  490|  28.7k|      probability_table_[i].prob = token_probs[i];
  491|  28.7k|      probability_table_[i].cum_prob = cum_prob;
  492|  28.7k|      cum_prob += token_probs[i];
  493|  28.7k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 61, False: 28.6k]
  ------------------
  494|     61|        return false;
  495|     61|      }
  496|  1.35G|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 1.35G, False: 28.6k]
  ------------------
  497|  1.35G|        lut_table_[j] = i;
  498|  1.35G|      }
  499|  28.6k|      act_prob = cum_prob;
  500|  28.6k|    }
  501|  1.42k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 170, False: 1.25k]
  ------------------
  502|    170|      return false;
  503|    170|    }
  504|  1.25k|    return true;
  505|  1.42k|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    645|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    645|    unsigned x;
  423|    645|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 31, False: 614]
  ------------------
  424|     31|      return 1;
  425|     31|    }
  426|    614|    ans_.buf = buf;
  427|    614|    x = buf[offset - 1] >> 6;
  428|    614|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 168, False: 446]
  ------------------
  429|    168|      ans_.buf_offset = offset - 1;
  430|    168|      ans_.state = buf[offset - 1] & 0x3F;
  431|    446|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 126, False: 320]
  ------------------
  432|    126|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 38, False: 88]
  ------------------
  433|     38|        return 1;
  434|     38|      }
  435|     88|      ans_.buf_offset = offset - 2;
  436|     88|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    320|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 103, False: 217]
  ------------------
  438|    103|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 20, False: 83]
  ------------------
  439|     20|        return 1;
  440|     20|      }
  441|     83|      ans_.buf_offset = offset - 3;
  442|     83|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    217|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 217, False: 0]
  ------------------
  444|    217|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 41, False: 176]
  ------------------
  445|     41|        return 1;
  446|     41|      }
  447|    176|      ans_.buf_offset = offset - 4;
  448|    176|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|    176|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    515|    ans_.state += l_rans_base;
  453|    515|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    515|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 44, False: 471]
  ------------------
  454|     44|      return 1;
  455|     44|    }
  456|    471|    return 0;
  457|    515|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  465|   131M|  inline int rans_read() {
  466|   131M|    unsigned rem;
  467|   131M|    unsigned quo;
  468|   131M|    struct rans_dec_sym sym;
  469|   131M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 115M, False: 15.7M]
  |  Branch (469:40): [True: 7.74k, False: 115M]
  ------------------
  470|  7.74k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  7.74k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  7.74k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   131M|    quo = ans_.state / rans_precision;
  475|   131M|    rem = ans_.state % rans_precision;
  476|   131M|    fetch_sym(&sym, rem);
  477|   131M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   131M|    return sym.val;
  479|   131M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  508|   131M|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   131M|    uint32_t symbol = lut_table_[rem];
  510|   131M|    out->val = symbol;
  511|   131M|    out->prob = probability_table_[symbol].prob;
  512|   131M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   131M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  459|    471|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.97k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.97k|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.97k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.97k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.97k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.97k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.97k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 133, False: 1.83k]
  ------------------
   67|    133|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 13, False: 120]
  ------------------
   68|     13|      return false;
   69|     13|    }
   70|       |
   71|    133|  } else
   72|  1.83k|#endif
   73|  1.83k|  {
   74|  1.83k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 61, False: 1.77k]
  ------------------
   75|     61|      return false;
   76|     61|    }
   77|  1.83k|  }
   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.89k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 119, False: 1.77k]
  ------------------
   83|    119|    return false;
   84|    119|  }
   85|  1.77k|  probability_table_.resize(num_symbols_);
   86|  1.77k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 669, False: 1.10k]
  ------------------
   87|    669|    return true;
   88|    669|  }
   89|       |  // Decode the table.
   90|   632k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 631k, False: 794]
  ------------------
   91|   631k|    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|   631k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 130, False: 631k]
  ------------------
   95|    130|      return false;
   96|    130|    }
   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|   631k|    const int token = prob_data & 3;
  102|   631k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 177k, False: 454k]
  ------------------
  103|   177k|      const uint32_t offset = prob_data >> 2;
  104|   177k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 143, False: 176k]
  ------------------
  105|    143|        return false;
  106|    143|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  6.55M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.37M, False: 176k]
  ------------------
  109|  6.37M|        probability_table_[i + j] = 0;
  110|  6.37M|      }
  111|   176k|      i += offset;
  112|   454k|    } else {
  113|   454k|      const int extra_bytes = token;
  114|   454k|      uint32_t prob = prob_data >> 2;
  115|   727k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 272k, False: 454k]
  ------------------
  116|   272k|        uint8_t eb;
  117|   272k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 42, False: 272k]
  ------------------
  118|     42|          return false;
  119|     42|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   272k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   272k|      }
  124|   454k|      probability_table_[i] = prob;
  125|   454k|    }
  126|   631k|  }
  127|    794|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 258, False: 536]
  ------------------
  128|    258|    return false;
  129|    258|  }
  130|    536|  return true;
  131|    794|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|  1.00k|    DecoderBuffer* buffer) {
  136|  1.00k|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|  1.00k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|  1.00k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.00k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 83, False: 923]
  ------------------
  140|     83|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 9, False: 74]
  ------------------
  141|      9|      return false;
  142|      9|    }
  143|       |
  144|     83|  } else
  145|    923|#endif
  146|    923|  {
  147|    923|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 45, False: 878]
  ------------------
  148|     45|      return false;
  149|     45|    }
  150|    923|  }
  151|    952|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 200, False: 752]
  ------------------
  152|    200|    return false;
  153|    200|  }
  154|    752|  const uint8_t* const data_head =
  155|    752|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    752|  buffer->Advance(bytes_encoded);
  158|    752|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 149, False: 603]
  ------------------
  159|    149|    return false;
  160|    149|  }
  161|    603|  return true;
  162|    752|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    816|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  3.83M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    503|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    503|  ans_.read_end();
  167|    503|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    746|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    746|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    746|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 746]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    746|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    746|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    746|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 63, False: 683]
  ------------------
   67|     63|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 7, False: 56]
  ------------------
   68|      7|      return false;
   69|      7|    }
   70|       |
   71|     63|  } else
   72|    683|#endif
   73|    683|  {
   74|    683|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 676]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    683|  }
   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|    732|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 48, False: 684]
  ------------------
   83|     48|    return false;
   84|     48|  }
   85|    684|  probability_table_.resize(num_symbols_);
   86|    684|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 28, False: 656]
  ------------------
   87|     28|    return true;
   88|     28|  }
   89|       |  // Decode the table.
   90|  3.17M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.16M, False: 462]
  ------------------
   91|  3.16M|    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|  3.16M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 85, False: 3.16M]
  ------------------
   95|     85|      return false;
   96|     85|    }
   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|  3.16M|    const int token = prob_data & 3;
  102|  3.16M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.01M, False: 2.15M]
  ------------------
  103|  1.01M|      const uint32_t offset = prob_data >> 2;
  104|  1.01M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 73, False: 1.01M]
  ------------------
  105|     73|        return false;
  106|     73|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  31.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 30.5M, False: 1.01M]
  ------------------
  109|  30.5M|        probability_table_[i + j] = 0;
  110|  30.5M|      }
  111|  1.01M|      i += offset;
  112|  2.15M|    } else {
  113|  2.15M|      const int extra_bytes = token;
  114|  2.15M|      uint32_t prob = prob_data >> 2;
  115|  2.16M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 11.7k, False: 2.15M]
  ------------------
  116|  11.7k|        uint8_t eb;
  117|  11.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 36, False: 11.7k]
  ------------------
  118|     36|          return false;
  119|     36|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  11.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  11.7k|      }
  124|  2.15M|      probability_table_[i] = prob;
  125|  2.15M|    }
  126|  3.16M|  }
  127|    462|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 162, False: 300]
  ------------------
  128|    162|    return false;
  129|    162|  }
  130|    300|  return true;
  131|    462|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    328|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    300|    DecoderBuffer* buffer) {
  136|    300|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    300|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    300|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    300|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 296]
  ------------------
  140|      4|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 3]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      4|  } else
  145|    296|#endif
  146|    296|  {
  147|    296|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 15, False: 281]
  ------------------
  148|     15|      return false;
  149|     15|    }
  150|    296|  }
  151|    284|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 256]
  ------------------
  152|     28|    return false;
  153|     28|  }
  154|    256|  const uint8_t* const data_head =
  155|    256|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    256|  buffer->Advance(bytes_encoded);
  158|    256|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 234]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|    234|  return true;
  162|    256|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  51.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    234|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    234|  ans_.read_end();
  167|    234|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    533|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    533|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    533|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 533]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    533|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    533|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    533|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 507]
  ------------------
   67|     26|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 23]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     26|  } 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|    519|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 44, False: 475]
  ------------------
   83|     44|    return false;
   84|     44|  }
   85|    475|  probability_table_.resize(num_symbols_);
   86|    475|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 461]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|  1.32M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.32M, False: 326]
  ------------------
   91|  1.32M|    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.32M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 80, False: 1.32M]
  ------------------
   95|     80|      return false;
   96|     80|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.32M|    const int token = prob_data & 3;
  102|  1.32M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 724k, False: 600k]
  ------------------
  103|   724k|      const uint32_t offset = prob_data >> 2;
  104|   724k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 31, False: 724k]
  ------------------
  105|     31|        return false;
  106|     31|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  22.3M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 21.5M, False: 724k]
  ------------------
  109|  21.5M|        probability_table_[i + j] = 0;
  110|  21.5M|      }
  111|   724k|      i += offset;
  112|   724k|    } else {
  113|   600k|      const int extra_bytes = token;
  114|   600k|      uint32_t prob = prob_data >> 2;
  115|  1.11M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 518k, False: 600k]
  ------------------
  116|   518k|        uint8_t eb;
  117|   518k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 518k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   518k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   518k|      }
  124|   600k|      probability_table_[i] = prob;
  125|   600k|    }
  126|  1.32M|  }
  127|    326|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 31, False: 295]
  ------------------
  128|     31|    return false;
  129|     31|  }
  130|    295|  return true;
  131|    326|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    309|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    295|    DecoderBuffer* buffer) {
  136|    295|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    295|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    295|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    295|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 288]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 5]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|      7|  } else
  145|    288|#endif
  146|    288|  {
  147|    288|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 14, False: 274]
  ------------------
  148|     14|      return false;
  149|     14|    }
  150|    288|  }
  151|    279|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 43, False: 236]
  ------------------
  152|     43|    return false;
  153|     43|  }
  154|    236|  const uint8_t* const data_head =
  155|    236|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    236|  buffer->Advance(bytes_encoded);
  158|    236|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 19, False: 217]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|    217|  return true;
  162|    236|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  4.20M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    217|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    217|  ans_.read_end();
  167|    217|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    455|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    455|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    455|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 455]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    455|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    455|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    455|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 417]
  ------------------
   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|    417|#endif
   73|    417|  {
   74|    417|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 407]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    417|  }
   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|    444|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 424]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    424|  probability_table_.resize(num_symbols_);
   86|    424|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 413]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  8.13k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.85k, False: 278]
  ------------------
   91|  7.85k|    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.85k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 63, False: 7.79k]
  ------------------
   95|     63|      return false;
   96|     63|    }
   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.79k|    const int token = prob_data & 3;
  102|  7.79k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.91k, False: 3.87k]
  ------------------
  103|  3.91k|      const uint32_t offset = prob_data >> 2;
  104|  3.91k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 3.88k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   131k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 127k, False: 3.88k]
  ------------------
  109|   127k|        probability_table_[i + j] = 0;
  110|   127k|      }
  111|  3.88k|      i += offset;
  112|  3.88k|    } else {
  113|  3.87k|      const int extra_bytes = token;
  114|  3.87k|      uint32_t prob = prob_data >> 2;
  115|  7.04k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.21k, False: 3.83k]
  ------------------
  116|  3.21k|        uint8_t eb;
  117|  3.21k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 42, False: 3.17k]
  ------------------
  118|     42|          return false;
  119|     42|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.17k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.17k|      }
  124|  3.83k|      probability_table_[i] = prob;
  125|  3.83k|    }
  126|  7.79k|  }
  127|    278|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 34, False: 244]
  ------------------
  128|     34|    return false;
  129|     34|  }
  130|    244|  return true;
  131|    278|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    255|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    244|    DecoderBuffer* buffer) {
  136|    244|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    244|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    244|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    244|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 31, False: 213]
  ------------------
  140|     31|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 26]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     31|  } else
  145|    213|#endif
  146|    213|  {
  147|    213|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 212]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    213|  }
  151|    238|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 57, False: 181]
  ------------------
  152|     57|    return false;
  153|     57|  }
  154|    181|  const uint8_t* const data_head =
  155|    181|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    181|  buffer->Advance(bytes_encoded);
  158|    181|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 143]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|    143|  return true;
  162|    181|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  25.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    143|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    143|  ans_.read_end();
  167|    143|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    465|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    465|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    465|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 465]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    465|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    465|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    465|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 33, False: 432]
  ------------------
   67|     33|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 30]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     33|  } else
   72|    432|#endif
   73|    432|  {
   74|    432|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 421]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    432|  }
   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|    451|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 428]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    428|  probability_table_.resize(num_symbols_);
   86|    428|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 17, False: 411]
  ------------------
   87|     17|    return true;
   88|     17|  }
   89|       |  // Decode the table.
   90|  5.70k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 5.41k, False: 285]
  ------------------
   91|  5.41k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  5.41k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 73, False: 5.34k]
  ------------------
   95|     73|      return false;
   96|     73|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  5.34k|    const int token = prob_data & 3;
  102|  5.34k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.94k, False: 2.40k]
  ------------------
  103|  2.94k|      const uint32_t offset = prob_data >> 2;
  104|  2.94k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 2.91k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  99.0k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 96.0k, False: 2.91k]
  ------------------
  109|  96.0k|        probability_table_[i + j] = 0;
  110|  96.0k|      }
  111|  2.91k|      i += offset;
  112|  2.91k|    } else {
  113|  2.40k|      const int extra_bytes = token;
  114|  2.40k|      uint32_t prob = prob_data >> 2;
  115|  4.31k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.93k, False: 2.38k]
  ------------------
  116|  1.93k|        uint8_t eb;
  117|  1.93k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 1.91k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.91k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.91k|      }
  124|  2.38k|      probability_table_[i] = prob;
  125|  2.38k|    }
  126|  5.34k|  }
  127|    285|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 25, False: 260]
  ------------------
  128|     25|    return false;
  129|     25|  }
  130|    260|  return true;
  131|    285|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    277|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    260|    DecoderBuffer* buffer) {
  136|    260|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    260|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    260|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    260|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 22, False: 238]
  ------------------
  140|     22|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 18]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     22|  } else
  145|    238|#endif
  146|    238|  {
  147|    238|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 228]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    238|  }
  151|    246|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 43, False: 203]
  ------------------
  152|     43|    return false;
  153|     43|  }
  154|    203|  const uint8_t* const data_head =
  155|    203|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    203|  buffer->Advance(bytes_encoded);
  158|    203|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 165]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|    165|  return true;
  162|    203|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  3.21M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    165|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    165|  ans_.read_end();
  167|    165|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    497|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    497|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    497|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 497]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    497|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    497|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    497|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 21, False: 476]
  ------------------
   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|    476|#endif
   73|    476|  {
   74|    476|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 471]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    476|  }
   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|    491|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 468]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    468|  probability_table_.resize(num_symbols_);
   86|    468|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 459]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  8.03k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.70k, False: 330]
  ------------------
   91|  7.70k|    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.70k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 86, False: 7.62k]
  ------------------
   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|  7.62k|    const int token = prob_data & 3;
  102|  7.62k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.79k, False: 3.83k]
  ------------------
  103|  3.79k|      const uint32_t offset = prob_data >> 2;
  104|  3.79k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 3.76k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   137k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 133k, False: 3.76k]
  ------------------
  109|   133k|        probability_table_[i + j] = 0;
  110|   133k|      }
  111|  3.76k|      i += offset;
  112|  3.83k|    } else {
  113|  3.83k|      const int extra_bytes = token;
  114|  3.83k|      uint32_t prob = prob_data >> 2;
  115|  6.48k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.66k, False: 3.81k]
  ------------------
  116|  2.66k|        uint8_t eb;
  117|  2.66k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 2.65k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.65k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.65k|      }
  124|  3.81k|      probability_table_[i] = prob;
  125|  3.81k|    }
  126|  7.62k|  }
  127|    330|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 304]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    304|  return true;
  131|    330|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    313|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    304|    DecoderBuffer* buffer) {
  136|    304|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    304|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    304|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    304|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 288]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 14]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     16|  } else
  145|    288|#endif
  146|    288|  {
  147|    288|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 287]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    288|  }
  151|    301|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 68, False: 233]
  ------------------
  152|     68|    return false;
  153|     68|  }
  154|    233|  const uint8_t* const data_head =
  155|    233|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    233|  buffer->Advance(bytes_encoded);
  158|    233|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 199]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|    199|  return true;
  162|    233|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  13.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    199|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    199|  ans_.read_end();
  167|    199|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    479|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    479|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    479|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 479]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    479|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    479|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    479|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 437]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 41]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     42|  } else
   72|    437|#endif
   73|    437|  {
   74|    437|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 430]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    437|  }
   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|    471|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 22, False: 449]
  ------------------
   83|     22|    return false;
   84|     22|  }
   85|    449|  probability_table_.resize(num_symbols_);
   86|    449|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 17, False: 432]
  ------------------
   87|     17|    return true;
   88|     17|  }
   89|       |  // Decode the table.
   90|  61.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 60.8k, False: 293]
  ------------------
   91|  60.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|  60.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 90, False: 60.7k]
  ------------------
   95|     90|      return false;
   96|     90|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  60.7k|    const int token = prob_data & 3;
  102|  60.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 18.5k, False: 42.1k]
  ------------------
  103|  18.5k|      const uint32_t offset = prob_data >> 2;
  104|  18.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 18.5k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   716k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 697k, False: 18.5k]
  ------------------
  109|   697k|        probability_table_[i + j] = 0;
  110|   697k|      }
  111|  18.5k|      i += offset;
  112|  42.1k|    } else {
  113|  42.1k|      const int extra_bytes = token;
  114|  42.1k|      uint32_t prob = prob_data >> 2;
  115|  65.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 23.8k, False: 42.1k]
  ------------------
  116|  23.8k|        uint8_t eb;
  117|  23.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 23.7k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  23.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  23.7k|      }
  124|  42.1k|      probability_table_[i] = prob;
  125|  42.1k|    }
  126|  60.7k|  }
  127|    293|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 270]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    270|  return true;
  131|    293|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    287|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    270|    DecoderBuffer* buffer) {
  136|    270|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    270|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    270|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    270|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 28, False: 242]
  ------------------
  140|     28|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 25]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     28|  } else
  145|    242|#endif
  146|    242|  {
  147|    242|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 241]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    242|  }
  151|    266|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 54, False: 212]
  ------------------
  152|     54|    return false;
  153|     54|  }
  154|    212|  const uint8_t* const data_head =
  155|    212|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    212|  buffer->Advance(bytes_encoded);
  158|    212|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 47, False: 165]
  ------------------
  159|     47|    return false;
  160|     47|  }
  161|    165|  return true;
  162|    212|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  11.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    165|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    165|  ans_.read_end();
  167|    165|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    393|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    393|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    393|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 393]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    393|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    393|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    393|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 8, False: 385]
  ------------------
   67|      8|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 6]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|      8|  } else
   72|    385|#endif
   73|    385|  {
   74|    385|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 19, False: 366]
  ------------------
   75|     19|      return false;
   76|     19|    }
   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|    372|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 349]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    349|  probability_table_.resize(num_symbols_);
   86|    349|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 343]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|   259k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 259k, False: 204]
  ------------------
   91|   259k|    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|   259k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 75, False: 259k]
  ------------------
   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|   259k|    const int token = prob_data & 3;
  102|   259k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 117k, False: 141k]
  ------------------
  103|   117k|      const uint32_t offset = prob_data >> 2;
  104|   117k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 117k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.62M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.50M, False: 117k]
  ------------------
  109|  3.50M|        probability_table_[i + j] = 0;
  110|  3.50M|      }
  111|   117k|      i += offset;
  112|   141k|    } else {
  113|   141k|      const int extra_bytes = token;
  114|   141k|      uint32_t prob = prob_data >> 2;
  115|   207k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 66.6k, False: 141k]
  ------------------
  116|  66.6k|        uint8_t eb;
  117|  66.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 32, False: 66.5k]
  ------------------
  118|     32|          return false;
  119|     32|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  66.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  66.5k|      }
  124|   141k|      probability_table_[i] = prob;
  125|   141k|    }
  126|   259k|  }
  127|    204|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 31, False: 173]
  ------------------
  128|     31|    return false;
  129|     31|  }
  130|    173|  return true;
  131|    204|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    179|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_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: 4, False: 169]
  ------------------
  140|      4|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 3]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      4|  } else
  145|    169|#endif
  146|    169|  {
  147|    169|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 168]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    169|  }
  151|    171|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 37, False: 134]
  ------------------
  152|     37|    return false;
  153|     37|  }
  154|    134|  const uint8_t* const data_head =
  155|    134|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    134|  buffer->Advance(bytes_encoded);
  158|    134|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 42, False: 92]
  ------------------
  159|     42|    return false;
  160|     42|  }
  161|     92|  return true;
  162|    134|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|   519k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     92|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     92|  ans_.read_end();
  167|     92|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    413|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    413|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    413|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 413]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    413|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    413|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    413|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 13, False: 400]
  ------------------
   67|     13|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 12]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     13|  } else
   72|    400|#endif
   73|    400|  {
   74|    400|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 397]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    400|  }
   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|    409|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 392]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    392|  probability_table_.resize(num_symbols_);
   86|    392|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 380]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|  24.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 24.0k, False: 250]
  ------------------
   91|  24.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  24.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 75, False: 23.9k]
  ------------------
   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|  23.9k|    const int token = prob_data & 3;
  102|  23.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 11.9k, False: 12.0k]
  ------------------
  103|  11.9k|      const uint32_t offset = prob_data >> 2;
  104|  11.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 11.8k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   304k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 292k, False: 11.8k]
  ------------------
  109|   292k|        probability_table_[i + j] = 0;
  110|   292k|      }
  111|  11.8k|      i += offset;
  112|  12.0k|    } else {
  113|  12.0k|      const int extra_bytes = token;
  114|  12.0k|      uint32_t prob = prob_data >> 2;
  115|  22.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.9k, False: 11.9k]
  ------------------
  116|  10.9k|        uint8_t eb;
  117|  10.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 10.9k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.9k|      }
  124|  11.9k|      probability_table_[i] = prob;
  125|  11.9k|    }
  126|  23.9k|  }
  127|    250|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 101, False: 149]
  ------------------
  128|    101|    return false;
  129|    101|  }
  130|    149|  return true;
  131|    250|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    161|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    149|    DecoderBuffer* buffer) {
  136|    149|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    149|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    149|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    149|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 149]
  ------------------
  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|    149|#endif
  146|    149|  {
  147|    149|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 147]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    149|  }
  151|    147|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 36, False: 111]
  ------------------
  152|     36|    return false;
  153|     36|  }
  154|    111|  const uint8_t* const data_head =
  155|    111|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    111|  buffer->Advance(bytes_encoded);
  158|    111|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 78]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     78|  return true;
  162|    111|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   161k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     78|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     78|  ans_.read_end();
  167|     78|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    467|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    467|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    467|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 467]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    467|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    467|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    467|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 11, False: 456]
  ------------------
   67|     11|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 10]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     11|  } else
   72|    456|#endif
   73|    456|  {
   74|    456|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 451]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    456|  }
   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|    461|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 22, False: 439]
  ------------------
   83|     22|    return false;
   84|     22|  }
   85|    439|  probability_table_.resize(num_symbols_);
   86|    439|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 434]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  54.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 54.3k, False: 286]
  ------------------
   91|  54.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|  54.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 84, False: 54.2k]
  ------------------
   95|     84|      return false;
   96|     84|    }
   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|  54.2k|    const int token = prob_data & 3;
  102|  54.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 19.6k, False: 34.5k]
  ------------------
  103|  19.6k|      const uint32_t offset = prob_data >> 2;
  104|  19.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 35, False: 19.6k]
  ------------------
  105|     35|        return false;
  106|     35|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   694k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 674k, False: 19.6k]
  ------------------
  109|   674k|        probability_table_[i + j] = 0;
  110|   674k|      }
  111|  19.6k|      i += offset;
  112|  34.5k|    } else {
  113|  34.5k|      const int extra_bytes = token;
  114|  34.5k|      uint32_t prob = prob_data >> 2;
  115|  60.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 26.2k, False: 34.5k]
  ------------------
  116|  26.2k|        uint8_t eb;
  117|  26.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 26.2k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  26.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  26.2k|      }
  124|  34.5k|      probability_table_[i] = prob;
  125|  34.5k|    }
  126|  54.2k|  }
  127|    286|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 76, False: 210]
  ------------------
  128|     76|    return false;
  129|     76|  }
  130|    210|  return true;
  131|    286|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    215|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    210|    DecoderBuffer* buffer) {
  136|    210|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    210|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    210|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    210|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 210]
  ------------------
  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|    210|#endif
  146|    210|  {
  147|    210|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 209]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    210|  }
  151|    209|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 95, False: 114]
  ------------------
  152|     95|    return false;
  153|     95|  }
  154|    114|  const uint8_t* const data_head =
  155|    114|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    114|  buffer->Advance(bytes_encoded);
  158|    114|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 29, False: 85]
  ------------------
  159|     29|    return false;
  160|     29|  }
  161|     85|  return true;
  162|    114|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   671k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     85|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     85|  ans_.read_end();
  167|     85|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    532|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    532|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    532|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 532]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    532|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    532|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    532|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 40, False: 492]
  ------------------
   67|     40|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 39]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     40|  } else
   72|    492|#endif
   73|    492|  {
   74|    492|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 486]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    492|  }
   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|    525|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 28, False: 497]
  ------------------
   83|     28|    return false;
   84|     28|  }
   85|    497|  probability_table_.resize(num_symbols_);
   86|    497|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 491]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  26.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 26.5k, False: 338]
  ------------------
   91|  26.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|  26.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 76, False: 26.4k]
  ------------------
   95|     76|      return false;
   96|     76|    }
   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|  26.4k|    const int token = prob_data & 3;
  102|  26.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.4k, False: 16.0k]
  ------------------
  103|  10.4k|      const uint32_t offset = prob_data >> 2;
  104|  10.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 45, False: 10.3k]
  ------------------
  105|     45|        return false;
  106|     45|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   307k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 296k, False: 10.3k]
  ------------------
  109|   296k|        probability_table_[i + j] = 0;
  110|   296k|      }
  111|  10.3k|      i += offset;
  112|  16.0k|    } else {
  113|  16.0k|      const int extra_bytes = token;
  114|  16.0k|      uint32_t prob = prob_data >> 2;
  115|  30.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 14.1k, False: 15.9k]
  ------------------
  116|  14.1k|        uint8_t eb;
  117|  14.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 32, False: 14.0k]
  ------------------
  118|     32|          return false;
  119|     32|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  14.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  14.0k|      }
  124|  15.9k|      probability_table_[i] = prob;
  125|  15.9k|    }
  126|  26.4k|  }
  127|    338|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 112, False: 226]
  ------------------
  128|    112|    return false;
  129|    112|  }
  130|    226|  return true;
  131|    338|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    232|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    226|    DecoderBuffer* buffer) {
  136|    226|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    226|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    226|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    226|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 226]
  ------------------
  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|    226|#endif
  146|    226|  {
  147|    226|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 221]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    226|  }
  151|    221|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 103, False: 118]
  ------------------
  152|    103|    return false;
  153|    103|  }
  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: 56, False: 62]
  ------------------
  159|     56|    return false;
  160|     56|  }
  161|     62|  return true;
  162|    118|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  37.4k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     62|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     62|  ans_.read_end();
  167|     62|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    536|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    536|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    536|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 536]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    536|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    536|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    536|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 6, False: 530]
  ------------------
   67|      6|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 3]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|      6|  } else
   72|    530|#endif
   73|    530|  {
   74|    530|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 15, False: 515]
  ------------------
   75|     15|      return false;
   76|     15|    }
   77|    530|  }
   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|    518|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 22, False: 496]
  ------------------
   83|     22|    return false;
   84|     22|  }
   85|    496|  probability_table_.resize(num_symbols_);
   86|    496|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 486]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   215k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 214k, False: 329]
  ------------------
   91|   214k|    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|   214k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 81, False: 214k]
  ------------------
   95|     81|      return false;
   96|     81|    }
   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|   214k|    const int token = prob_data & 3;
  102|   214k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 77.3k, False: 137k]
  ------------------
  103|  77.3k|      const uint32_t offset = prob_data >> 2;
  104|  77.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 46, False: 77.2k]
  ------------------
  105|     46|        return false;
  106|     46|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.56M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.49M, False: 77.2k]
  ------------------
  109|  1.49M|        probability_table_[i + j] = 0;
  110|  1.49M|      }
  111|  77.2k|      i += offset;
  112|   137k|    } else {
  113|   137k|      const int extra_bytes = token;
  114|   137k|      uint32_t prob = prob_data >> 2;
  115|   312k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 175k, False: 137k]
  ------------------
  116|   175k|        uint8_t eb;
  117|   175k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 30, False: 175k]
  ------------------
  118|     30|          return false;
  119|     30|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   175k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   175k|      }
  124|   137k|      probability_table_[i] = prob;
  125|   137k|    }
  126|   214k|  }
  127|    329|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 117, False: 212]
  ------------------
  128|    117|    return false;
  129|    117|  }
  130|    212|  return true;
  131|    329|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    222|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    212|    DecoderBuffer* buffer) {
  136|    212|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    212|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    212|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    212|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 212]
  ------------------
  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|    212|#endif
  146|    212|  {
  147|    212|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 209]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    212|  }
  151|    209|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 85, False: 124]
  ------------------
  152|     85|    return false;
  153|     85|  }
  154|    124|  const uint8_t* const data_head =
  155|    124|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    124|  buffer->Advance(bytes_encoded);
  158|    124|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 47, False: 77]
  ------------------
  159|     47|    return false;
  160|     47|  }
  161|     77|  return true;
  162|    124|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   359k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     77|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     77|  ans_.read_end();
  167|     77|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    602|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    602|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    602|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 602]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    602|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    602|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    602|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 16, False: 586]
  ------------------
   67|     16|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 14]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     16|  } else
   72|    586|#endif
   73|    586|  {
   74|    586|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 581]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    586|  }
   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|    595|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 29, False: 566]
  ------------------
   83|     29|    return false;
   84|     29|  }
   85|    566|  probability_table_.resize(num_symbols_);
   86|    566|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 555]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   183k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 183k, False: 387]
  ------------------
   91|   183k|    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|   183k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 80, False: 183k]
  ------------------
   95|     80|      return false;
   96|     80|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   183k|    const int token = prob_data & 3;
  102|   183k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 55.0k, False: 128k]
  ------------------
  103|  55.0k|      const uint32_t offset = prob_data >> 2;
  104|  55.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 47, False: 55.0k]
  ------------------
  105|     47|        return false;
  106|     47|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.10M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.05M, False: 55.0k]
  ------------------
  109|  3.05M|        probability_table_[i + j] = 0;
  110|  3.05M|      }
  111|  55.0k|      i += offset;
  112|   128k|    } else {
  113|   128k|      const int extra_bytes = token;
  114|   128k|      uint32_t prob = prob_data >> 2;
  115|   182k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 54.2k, False: 128k]
  ------------------
  116|  54.2k|        uint8_t eb;
  117|  54.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 41, False: 54.2k]
  ------------------
  118|     41|          return false;
  119|     41|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  54.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  54.2k|      }
  124|   128k|      probability_table_[i] = prob;
  125|   128k|    }
  126|   183k|  }
  127|    387|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 127, False: 260]
  ------------------
  128|    127|    return false;
  129|    127|  }
  130|    260|  return true;
  131|    387|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    271|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    260|    DecoderBuffer* buffer) {
  136|    260|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    260|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    260|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    260|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 260]
  ------------------
  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|    260|#endif
  146|    260|  {
  147|    260|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 11, False: 249]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|    260|  }
  151|    249|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 108, False: 141]
  ------------------
  152|    108|    return false;
  153|    108|  }
  154|    141|  const uint8_t* const data_head =
  155|    141|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    141|  buffer->Advance(bytes_encoded);
  158|    141|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 49, False: 92]
  ------------------
  159|     49|    return false;
  160|     49|  }
  161|     92|  return true;
  162|    141|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   732k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     92|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     92|  ans_.read_end();
  167|     92|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    584|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    584|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    584|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 584]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    584|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    584|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    584|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 23, False: 561]
  ------------------
   67|     23|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 22]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     23|  } else
   72|    561|#endif
   73|    561|  {
   74|    561|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 12, False: 549]
  ------------------
   75|     12|      return false;
   76|     12|    }
   77|    561|  }
   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|    571|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 42, False: 529]
  ------------------
   83|     42|    return false;
   84|     42|  }
   85|    529|  probability_table_.resize(num_symbols_);
   86|    529|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 15, False: 514]
  ------------------
   87|     15|    return true;
   88|     15|  }
   89|       |  // Decode the table.
   90|   316k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 316k, False: 349]
  ------------------
   91|   316k|    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|   316k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 88, False: 316k]
  ------------------
   95|     88|      return false;
   96|     88|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   316k|    const int token = prob_data & 3;
  102|   316k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 120k, False: 195k]
  ------------------
  103|   120k|      const uint32_t offset = prob_data >> 2;
  104|   120k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 35, False: 120k]
  ------------------
  105|     35|        return false;
  106|     35|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.39M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.27M, False: 120k]
  ------------------
  109|  3.27M|        probability_table_[i + j] = 0;
  110|  3.27M|      }
  111|   120k|      i += offset;
  112|   195k|    } else {
  113|   195k|      const int extra_bytes = token;
  114|   195k|      uint32_t prob = prob_data >> 2;
  115|   344k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 148k, False: 195k]
  ------------------
  116|   148k|        uint8_t eb;
  117|   148k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 42, False: 148k]
  ------------------
  118|     42|          return false;
  119|     42|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   148k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   148k|      }
  124|   195k|      probability_table_[i] = prob;
  125|   195k|    }
  126|   316k|  }
  127|    349|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 70, False: 279]
  ------------------
  128|     70|    return false;
  129|     70|  }
  130|    279|  return true;
  131|    349|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    294|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    279|    DecoderBuffer* buffer) {
  136|    279|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    279|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    279|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    279|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 272]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 6]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      7|  } else
  145|    272|#endif
  146|    272|  {
  147|    272|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 265]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    272|  }
  151|    271|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 123, False: 148]
  ------------------
  152|    123|    return false;
  153|    123|  }
  154|    148|  const uint8_t* const data_head =
  155|    148|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    148|  buffer->Advance(bytes_encoded);
  158|    148|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 47, False: 101]
  ------------------
  159|     47|    return false;
  160|     47|  }
  161|    101|  return true;
  162|    148|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  17.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|    101|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    101|  ans_.read_end();
  167|    101|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    542|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    542|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    542|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 542]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    542|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    542|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    542|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 76, False: 466]
  ------------------
   67|     76|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 74]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     76|  } else
   72|    466|#endif
   73|    466|  {
   74|    466|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 462]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    466|  }
   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|    536|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 33, False: 503]
  ------------------
   83|     33|    return false;
   84|     33|  }
   85|    503|  probability_table_.resize(num_symbols_);
   86|    503|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 17, False: 486]
  ------------------
   87|     17|    return true;
   88|     17|  }
   89|       |  // Decode the table.
   90|   411k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 411k, False: 316]
  ------------------
   91|   411k|    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|   411k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 100, False: 411k]
  ------------------
   95|    100|      return false;
   96|    100|    }
   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|   411k|    const int token = prob_data & 3;
  102|   411k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 117k, False: 293k]
  ------------------
  103|   117k|      const uint32_t offset = prob_data >> 2;
  104|   117k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 117k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.07M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.96M, False: 117k]
  ------------------
  109|  3.96M|        probability_table_[i + j] = 0;
  110|  3.96M|      }
  111|   117k|      i += offset;
  112|   293k|    } else {
  113|   293k|      const int extra_bytes = token;
  114|   293k|      uint32_t prob = prob_data >> 2;
  115|   460k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 167k, False: 293k]
  ------------------
  116|   167k|        uint8_t eb;
  117|   167k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 36, False: 166k]
  ------------------
  118|     36|          return false;
  119|     36|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   166k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   166k|      }
  124|   293k|      probability_table_[i] = prob;
  125|   293k|    }
  126|   411k|  }
  127|    316|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 55, False: 261]
  ------------------
  128|     55|    return false;
  129|     55|  }
  130|    261|  return true;
  131|    316|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    278|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    261|    DecoderBuffer* buffer) {
  136|    261|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    261|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    261|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    261|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 57, False: 204]
  ------------------
  140|     57|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 56]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     57|  } else
  145|    204|#endif
  146|    204|  {
  147|    204|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 194]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    204|  }
  151|    250|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 104, False: 146]
  ------------------
  152|    104|    return false;
  153|    104|  }
  154|    146|  const uint8_t* const data_head =
  155|    146|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    146|  buffer->Advance(bytes_encoded);
  158|    146|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 51, False: 95]
  ------------------
  159|     51|    return false;
  160|     51|  }
  161|     95|  return true;
  162|    146|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  8.71M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     95|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     95|  ans_.read_end();
  167|     95|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    487|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    487|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    487|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 487]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    487|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    487|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    487|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 33, False: 454]
  ------------------
   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|    454|#endif
   73|    454|  {
   74|    454|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 22, False: 432]
  ------------------
   75|     22|      return false;
   76|     22|    }
   77|    454|  }
   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|    464|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 35, False: 429]
  ------------------
   83|     35|    return false;
   84|     35|  }
   85|    429|  probability_table_.resize(num_symbols_);
   86|    429|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 421]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  9.78k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.49k, False: 287]
  ------------------
   91|  9.49k|    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|  9.49k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 80, False: 9.41k]
  ------------------
   95|     80|      return false;
   96|     80|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  9.41k|    const int token = prob_data & 3;
  102|  9.41k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.97k, False: 5.44k]
  ------------------
  103|  3.97k|      const uint32_t offset = prob_data >> 2;
  104|  3.97k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 31, False: 3.94k]
  ------------------
  105|     31|        return false;
  106|     31|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   139k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 135k, False: 3.94k]
  ------------------
  109|   135k|        probability_table_[i + j] = 0;
  110|   135k|      }
  111|  3.94k|      i += offset;
  112|  5.44k|    } else {
  113|  5.44k|      const int extra_bytes = token;
  114|  5.44k|      uint32_t prob = prob_data >> 2;
  115|  8.82k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.40k, False: 5.41k]
  ------------------
  116|  3.40k|        uint8_t eb;
  117|  3.40k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 3.38k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.38k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.38k|      }
  124|  5.41k|      probability_table_[i] = prob;
  125|  5.41k|    }
  126|  9.41k|  }
  127|    287|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 33, False: 254]
  ------------------
  128|     33|    return false;
  129|     33|  }
  130|    254|  return true;
  131|    287|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    262|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    254|    DecoderBuffer* buffer) {
  136|    254|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    254|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    254|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    254|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 17, False: 237]
  ------------------
  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|    237|#endif
  146|    237|  {
  147|    237|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 225]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    237|  }
  151|    240|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 114, False: 126]
  ------------------
  152|    114|    return false;
  153|    114|  }
  154|    126|  const uint8_t* const data_head =
  155|    126|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    126|  buffer->Advance(bytes_encoded);
  158|    126|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 93]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     93|  return true;
  162|    126|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  19.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     93|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     93|  ans_.read_end();
  167|     93|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    481|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    481|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    481|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 481]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    481|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    481|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    481|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 60, False: 421]
  ------------------
   67|     60|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 58]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     60|  } else
   72|    421|#endif
   73|    421|  {
   74|    421|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 417]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    421|  }
   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|    475|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 456]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    456|  probability_table_.resize(num_symbols_);
   86|    456|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 445]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   829k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 829k, False: 269]
  ------------------
   91|   829k|    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|   829k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 103, False: 829k]
  ------------------
   95|    103|      return false;
   96|    103|    }
   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|   829k|    const int token = prob_data & 3;
  102|   829k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 306k, False: 522k]
  ------------------
  103|   306k|      const uint32_t offset = prob_data >> 2;
  104|   306k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 306k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.55M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.24M, False: 306k]
  ------------------
  109|  7.24M|        probability_table_[i + j] = 0;
  110|  7.24M|      }
  111|   306k|      i += offset;
  112|   522k|    } else {
  113|   522k|      const int extra_bytes = token;
  114|   522k|      uint32_t prob = prob_data >> 2;
  115|  1.04M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 521k, False: 522k]
  ------------------
  116|   521k|        uint8_t eb;
  117|   521k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 45, False: 521k]
  ------------------
  118|     45|          return false;
  119|     45|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   521k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   521k|      }
  124|   522k|      probability_table_[i] = prob;
  125|   522k|    }
  126|   829k|  }
  127|    269|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 40, False: 229]
  ------------------
  128|     40|    return false;
  129|     40|  }
  130|    229|  return true;
  131|    269|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    240|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    229|    DecoderBuffer* buffer) {
  136|    229|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    229|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    229|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    229|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 193]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 31]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     36|  } else
  145|    193|#endif
  146|    193|  {
  147|    193|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 191]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    193|  }
  151|    222|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 104, False: 118]
  ------------------
  152|    104|    return false;
  153|    104|  }
  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: 26, False: 92]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     92|  return true;
  162|    118|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  19.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     92|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     92|  ans_.read_end();
  167|     92|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    475|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    475|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    475|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 475]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    475|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    475|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    475|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 96, False: 379]
  ------------------
   67|     96|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 94]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     96|  } else
   72|    379|#endif
   73|    379|  {
   74|    379|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 17, False: 362]
  ------------------
   75|     17|      return false;
   76|     17|    }
   77|    379|  }
   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|    456|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 27, False: 429]
  ------------------
   83|     27|    return false;
   84|     27|  }
   85|    429|  probability_table_.resize(num_symbols_);
   86|    429|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 423]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  12.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 12.0k, False: 266]
  ------------------
   91|  12.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  12.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 80, False: 12.0k]
  ------------------
   95|     80|      return false;
   96|     80|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  12.0k|    const int token = prob_data & 3;
  102|  12.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.29k, False: 6.71k]
  ------------------
  103|  5.29k|      const uint32_t offset = prob_data >> 2;
  104|  5.29k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 49, False: 5.25k]
  ------------------
  105|     49|        return false;
  106|     49|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   177k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 172k, False: 5.25k]
  ------------------
  109|   172k|        probability_table_[i + j] = 0;
  110|   172k|      }
  111|  5.25k|      i += offset;
  112|  6.71k|    } else {
  113|  6.71k|      const int extra_bytes = token;
  114|  6.71k|      uint32_t prob = prob_data >> 2;
  115|  11.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.90k, False: 6.69k]
  ------------------
  116|  4.90k|        uint8_t eb;
  117|  4.90k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 4.87k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.87k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.87k|      }
  124|  6.69k|      probability_table_[i] = prob;
  125|  6.69k|    }
  126|  12.0k|  }
  127|    266|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 33, False: 233]
  ------------------
  128|     33|    return false;
  129|     33|  }
  130|    233|  return true;
  131|    266|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    239|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_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: 79, False: 154]
  ------------------
  140|     79|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 75]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     79|  } else
  145|    154|#endif
  146|    154|  {
  147|    154|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 151]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    154|  }
  151|    226|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 119, False: 107]
  ------------------
  152|    119|    return false;
  153|    119|  }
  154|    107|  const uint8_t* const data_head =
  155|    107|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    107|  buffer->Advance(bytes_encoded);
  158|    107|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 17, False: 90]
  ------------------
  159|     17|    return false;
  160|     17|  }
  161|     90|  return true;
  162|    107|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  66.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     90|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     90|  ans_.read_end();
  167|     90|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  14.4k|                   DecoderBuffer* src_buffer, uint32_t* out_values) {
   34|  14.4k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 38, False: 14.4k]
  ------------------
   35|     38|    return true;
   36|     38|  }
   37|       |  // Decode which scheme to use.
   38|  14.4k|  uint8_t scheme;
   39|  14.4k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 284, False: 14.1k]
  ------------------
   40|    284|    return false;
   41|    284|  }
   42|  14.1k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.62k, False: 12.5k]
  ------------------
   43|  1.62k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.62k|                                                  src_buffer, out_values);
   45|  12.5k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 9.40k, False: 3.09k]
  ------------------
   46|  9.40k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  9.40k|                                               out_values);
   48|  9.40k|  }
   49|  3.09k|  return false;
   50|  14.1k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.62k|                         DecoderBuffer* src_buffer, uint32_t* out_values) {
   55|       |  // Decode the encoded data.
   56|  1.62k|  SymbolDecoderT<5> tag_decoder;
   57|  1.62k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 732, False: 896]
  ------------------
   58|    732|    return false;
   59|    732|  }
   60|       |
   61|    896|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 389, False: 507]
  ------------------
   62|    389|    return false;
   63|    389|  }
   64|       |
   65|    507|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 507, False: 0]
  |  Branch (65:25): [True: 88, False: 419]
  ------------------
   66|     88|    return false;  // Wrong number of symbols.
   67|     88|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    419|  src_buffer->StartBitDecoding(false, nullptr);
   72|    419|  int value_id = 0;
   73|  2.70M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 2.70M, False: 407]
  ------------------
   74|       |    // Decode the tag.
   75|  2.70M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  5.71M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 3.00M, False: 2.70M]
  ------------------
   78|  3.00M|      uint32_t val;
   79|  3.00M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 12, False: 3.00M]
  ------------------
   80|     12|        return false;
   81|     12|      }
   82|  3.00M|      out_values[value_id++] = val;
   83|  3.00M|    }
   84|  2.70M|  }
   85|    407|  tag_decoder.EndDecoding();
   86|    407|  src_buffer->EndBitDecoding();
   87|    407|  return true;
   88|    419|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  9.40k|                      uint32_t* out_values) {
  117|  9.40k|  uint8_t max_bit_length;
  118|  9.40k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 43, False: 9.36k]
  ------------------
  119|     43|    return false;
  120|     43|  }
  121|  9.36k|  switch (max_bit_length) {
  122|    746|    case 1:
  ------------------
  |  Branch (122:5): [True: 746, False: 8.62k]
  ------------------
  123|    746|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    746|                                                         out_values);
  125|    533|    case 2:
  ------------------
  |  Branch (125:5): [True: 533, False: 8.83k]
  ------------------
  126|    533|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    533|                                                         out_values);
  128|    455|    case 3:
  ------------------
  |  Branch (128:5): [True: 455, False: 8.91k]
  ------------------
  129|    455|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    455|                                                         out_values);
  131|    465|    case 4:
  ------------------
  |  Branch (131:5): [True: 465, False: 8.90k]
  ------------------
  132|    465|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    465|                                                         out_values);
  134|    343|    case 5:
  ------------------
  |  Branch (134:5): [True: 343, False: 9.02k]
  ------------------
  135|    343|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    343|                                                         out_values);
  137|    497|    case 6:
  ------------------
  |  Branch (137:5): [True: 497, False: 8.86k]
  ------------------
  138|    497|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    497|                                                         out_values);
  140|    479|    case 7:
  ------------------
  |  Branch (140:5): [True: 479, False: 8.88k]
  ------------------
  141|    479|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    479|                                                         out_values);
  143|    393|    case 8:
  ------------------
  |  Branch (143:5): [True: 393, False: 8.97k]
  ------------------
  144|    393|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    393|                                                         out_values);
  146|    413|    case 9:
  ------------------
  |  Branch (146:5): [True: 413, False: 8.95k]
  ------------------
  147|    413|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    413|                                                         out_values);
  149|    467|    case 10:
  ------------------
  |  Branch (149:5): [True: 467, False: 8.89k]
  ------------------
  150|    467|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    467|          num_values, src_buffer, out_values);
  152|    532|    case 11:
  ------------------
  |  Branch (152:5): [True: 532, False: 8.83k]
  ------------------
  153|    532|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    532|          num_values, src_buffer, out_values);
  155|    536|    case 12:
  ------------------
  |  Branch (155:5): [True: 536, False: 8.83k]
  ------------------
  156|    536|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    536|          num_values, src_buffer, out_values);
  158|    602|    case 13:
  ------------------
  |  Branch (158:5): [True: 602, False: 8.76k]
  ------------------
  159|    602|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    602|          num_values, src_buffer, out_values);
  161|    584|    case 14:
  ------------------
  |  Branch (161:5): [True: 584, False: 8.78k]
  ------------------
  162|    584|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    584|          num_values, src_buffer, out_values);
  164|    542|    case 15:
  ------------------
  |  Branch (164:5): [True: 542, False: 8.82k]
  ------------------
  165|    542|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    542|          num_values, src_buffer, out_values);
  167|    487|    case 16:
  ------------------
  |  Branch (167:5): [True: 487, False: 8.87k]
  ------------------
  168|    487|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    487|          num_values, src_buffer, out_values);
  170|    481|    case 17:
  ------------------
  |  Branch (170:5): [True: 481, False: 8.88k]
  ------------------
  171|    481|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    481|          num_values, src_buffer, out_values);
  173|    475|    case 18:
  ------------------
  |  Branch (173:5): [True: 475, False: 8.89k]
  ------------------
  174|    475|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    475|          num_values, src_buffer, out_values);
  176|    336|    default:
  ------------------
  |  Branch (176:5): [True: 336, False: 9.03k]
  ------------------
  177|    336|      return false;
  178|  9.36k|  }
  179|  9.36k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    746|                              uint32_t* out_values) {
   93|    746|  SymbolDecoderT decoder;
   94|    746|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 418, False: 328]
  ------------------
   95|    418|    return false;
   96|    418|  }
   97|       |
   98|    328|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 328, False: 0]
  |  Branch (98:25): [True: 28, False: 300]
  ------------------
   99|     28|    return false;  // Wrong number of symbols.
  100|     28|  }
  101|       |
  102|    300|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 66, False: 234]
  ------------------
  103|     66|    return false;
  104|     66|  }
  105|  51.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 51.6M, False: 234]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  51.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  51.6M|    out_values[i] = value;
  109|  51.6M|  }
  110|    234|  decoder.EndDecoding();
  111|    234|  return true;
  112|    300|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    533|                              uint32_t* out_values) {
   93|    533|  SymbolDecoderT decoder;
   94|    533|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 224, False: 309]
  ------------------
   95|    224|    return false;
   96|    224|  }
   97|       |
   98|    309|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 309, False: 0]
  |  Branch (98:25): [True: 14, False: 295]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    295|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 78, False: 217]
  ------------------
  103|     78|    return false;
  104|     78|  }
  105|  4.20M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.20M, False: 217]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.20M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.20M|    out_values[i] = value;
  109|  4.20M|  }
  110|    217|  decoder.EndDecoding();
  111|    217|  return true;
  112|    295|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    455|                              uint32_t* out_values) {
   93|    455|  SymbolDecoderT decoder;
   94|    455|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 200, False: 255]
  ------------------
   95|    200|    return false;
   96|    200|  }
   97|       |
   98|    255|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 255, False: 0]
  |  Branch (98:25): [True: 11, False: 244]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    244|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 101, False: 143]
  ------------------
  103|    101|    return false;
  104|    101|  }
  105|  25.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 25.8M, False: 143]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  25.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  25.8M|    out_values[i] = value;
  109|  25.8M|  }
  110|    143|  decoder.EndDecoding();
  111|    143|  return true;
  112|    244|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    465|                              uint32_t* out_values) {
   93|    465|  SymbolDecoderT decoder;
   94|    465|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 188, False: 277]
  ------------------
   95|    188|    return false;
   96|    188|  }
   97|       |
   98|    277|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 277, False: 0]
  |  Branch (98:25): [True: 17, False: 260]
  ------------------
   99|     17|    return false;  // Wrong number of symbols.
  100|     17|  }
  101|       |
  102|    260|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 95, False: 165]
  ------------------
  103|     95|    return false;
  104|     95|  }
  105|  3.21M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.21M, False: 165]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.21M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.21M|    out_values[i] = value;
  109|  3.21M|  }
  110|    165|  decoder.EndDecoding();
  111|    165|  return true;
  112|    260|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    343|                              uint32_t* out_values) {
   93|    343|  SymbolDecoderT decoder;
   94|    343|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 34, False: 309]
  ------------------
   95|     34|    return false;
   96|     34|  }
   97|       |
   98|    309|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 309, False: 0]
  |  Branch (98:25): [True: 199, False: 110]
  ------------------
   99|    199|    return false;  // Wrong number of symbols.
  100|    199|  }
  101|       |
  102|    110|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 14, False: 96]
  ------------------
  103|     14|    return false;
  104|     14|  }
  105|  1.12M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.12M, False: 96]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.12M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.12M|    out_values[i] = value;
  109|  1.12M|  }
  110|     96|  decoder.EndDecoding();
  111|     96|  return true;
  112|    110|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    497|                              uint32_t* out_values) {
   93|    497|  SymbolDecoderT decoder;
   94|    497|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 184, False: 313]
  ------------------
   95|    184|    return false;
   96|    184|  }
   97|       |
   98|    313|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 313, False: 0]
  |  Branch (98:25): [True: 9, False: 304]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    304|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 105, False: 199]
  ------------------
  103|    105|    return false;
  104|    105|  }
  105|  13.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 13.8M, False: 199]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  13.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  13.8M|    out_values[i] = value;
  109|  13.8M|  }
  110|    199|  decoder.EndDecoding();
  111|    199|  return true;
  112|    304|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    479|                              uint32_t* out_values) {
   93|    479|  SymbolDecoderT decoder;
   94|    479|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 192, False: 287]
  ------------------
   95|    192|    return false;
   96|    192|  }
   97|       |
   98|    287|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 287, False: 0]
  |  Branch (98:25): [True: 17, False: 270]
  ------------------
   99|     17|    return false;  // Wrong number of symbols.
  100|     17|  }
  101|       |
  102|    270|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 105, False: 165]
  ------------------
  103|    105|    return false;
  104|    105|  }
  105|  11.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.3M, False: 165]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.3M|    out_values[i] = value;
  109|  11.3M|  }
  110|    165|  decoder.EndDecoding();
  111|    165|  return true;
  112|    270|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    393|                              uint32_t* out_values) {
   93|    393|  SymbolDecoderT decoder;
   94|    393|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 214, False: 179]
  ------------------
   95|    214|    return false;
   96|    214|  }
   97|       |
   98|    179|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 179, False: 0]
  |  Branch (98:25): [True: 6, False: 173]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    173|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 81, False: 92]
  ------------------
  103|     81|    return false;
  104|     81|  }
  105|   520k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 519k, False: 92]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   519k|    const uint32_t value = decoder.DecodeSymbol();
  108|   519k|    out_values[i] = value;
  109|   519k|  }
  110|     92|  decoder.EndDecoding();
  111|     92|  return true;
  112|    173|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    413|                              uint32_t* out_values) {
   93|    413|  SymbolDecoderT decoder;
   94|    413|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 252, False: 161]
  ------------------
   95|    252|    return false;
   96|    252|  }
   97|       |
   98|    161|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 161, False: 0]
  |  Branch (98:25): [True: 12, False: 149]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    149|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 71, False: 78]
  ------------------
  103|     71|    return false;
  104|     71|  }
  105|   161k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 161k, False: 78]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   161k|    const uint32_t value = decoder.DecodeSymbol();
  108|   161k|    out_values[i] = value;
  109|   161k|  }
  110|     78|  decoder.EndDecoding();
  111|     78|  return true;
  112|    149|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    467|                              uint32_t* out_values) {
   93|    467|  SymbolDecoderT decoder;
   94|    467|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 252, False: 215]
  ------------------
   95|    252|    return false;
   96|    252|  }
   97|       |
   98|    215|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 215, False: 0]
  |  Branch (98:25): [True: 5, False: 210]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    210|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 125, False: 85]
  ------------------
  103|    125|    return false;
  104|    125|  }
  105|   671k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 671k, False: 85]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   671k|    const uint32_t value = decoder.DecodeSymbol();
  108|   671k|    out_values[i] = value;
  109|   671k|  }
  110|     85|  decoder.EndDecoding();
  111|     85|  return true;
  112|    210|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    532|                              uint32_t* out_values) {
   93|    532|  SymbolDecoderT decoder;
   94|    532|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 300, False: 232]
  ------------------
   95|    300|    return false;
   96|    300|  }
   97|       |
   98|    232|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 232, False: 0]
  |  Branch (98:25): [True: 6, False: 226]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    226|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 164, False: 62]
  ------------------
  103|    164|    return false;
  104|    164|  }
  105|  37.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 37.4k, False: 62]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  37.4k|    const uint32_t value = decoder.DecodeSymbol();
  108|  37.4k|    out_values[i] = value;
  109|  37.4k|  }
  110|     62|  decoder.EndDecoding();
  111|     62|  return true;
  112|    226|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    536|                              uint32_t* out_values) {
   93|    536|  SymbolDecoderT decoder;
   94|    536|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 314, False: 222]
  ------------------
   95|    314|    return false;
   96|    314|  }
   97|       |
   98|    222|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 222, False: 0]
  |  Branch (98:25): [True: 10, False: 212]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    212|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 135, False: 77]
  ------------------
  103|    135|    return false;
  104|    135|  }
  105|   359k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 359k, False: 77]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   359k|    const uint32_t value = decoder.DecodeSymbol();
  108|   359k|    out_values[i] = value;
  109|   359k|  }
  110|     77|  decoder.EndDecoding();
  111|     77|  return true;
  112|    212|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    602|                              uint32_t* out_values) {
   93|    602|  SymbolDecoderT decoder;
   94|    602|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 331, False: 271]
  ------------------
   95|    331|    return false;
   96|    331|  }
   97|       |
   98|    271|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 271, False: 0]
  |  Branch (98:25): [True: 11, False: 260]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    260|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 168, False: 92]
  ------------------
  103|    168|    return false;
  104|    168|  }
  105|   732k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 732k, False: 92]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   732k|    const uint32_t value = decoder.DecodeSymbol();
  108|   732k|    out_values[i] = value;
  109|   732k|  }
  110|     92|  decoder.EndDecoding();
  111|     92|  return true;
  112|    260|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    584|                              uint32_t* out_values) {
   93|    584|  SymbolDecoderT decoder;
   94|    584|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 290, False: 294]
  ------------------
   95|    290|    return false;
   96|    290|  }
   97|       |
   98|    294|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 294, False: 0]
  |  Branch (98:25): [True: 15, False: 279]
  ------------------
   99|     15|    return false;  // Wrong number of symbols.
  100|     15|  }
  101|       |
  102|    279|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 178, False: 101]
  ------------------
  103|    178|    return false;
  104|    178|  }
  105|  17.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 17.9M, False: 101]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  17.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  17.9M|    out_values[i] = value;
  109|  17.9M|  }
  110|    101|  decoder.EndDecoding();
  111|    101|  return true;
  112|    279|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    542|                              uint32_t* out_values) {
   93|    542|  SymbolDecoderT decoder;
   94|    542|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 264, False: 278]
  ------------------
   95|    264|    return false;
   96|    264|  }
   97|       |
   98|    278|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 278, False: 0]
  |  Branch (98:25): [True: 17, False: 261]
  ------------------
   99|     17|    return false;  // Wrong number of symbols.
  100|     17|  }
  101|       |
  102|    261|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 166, False: 95]
  ------------------
  103|    166|    return false;
  104|    166|  }
  105|  8.71M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.71M, False: 95]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.71M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.71M|    out_values[i] = value;
  109|  8.71M|  }
  110|     95|  decoder.EndDecoding();
  111|     95|  return true;
  112|    261|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    487|                              uint32_t* out_values) {
   93|    487|  SymbolDecoderT decoder;
   94|    487|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 225, False: 262]
  ------------------
   95|    225|    return false;
   96|    225|  }
   97|       |
   98|    262|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 262, False: 0]
  |  Branch (98:25): [True: 8, False: 254]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    254|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 161, False: 93]
  ------------------
  103|    161|    return false;
  104|    161|  }
  105|  19.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 19.4M, False: 93]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  19.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  19.4M|    out_values[i] = value;
  109|  19.4M|  }
  110|     93|  decoder.EndDecoding();
  111|     93|  return true;
  112|    254|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    481|                              uint32_t* out_values) {
   93|    481|  SymbolDecoderT decoder;
   94|    481|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 241, False: 240]
  ------------------
   95|    241|    return false;
   96|    241|  }
   97|       |
   98|    240|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 240, False: 0]
  |  Branch (98:25): [True: 11, False: 229]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    229|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 137, False: 92]
  ------------------
  103|    137|    return false;
  104|    137|  }
  105|  19.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 19.1M, False: 92]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  19.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  19.1M|    out_values[i] = value;
  109|  19.1M|  }
  110|     92|  decoder.EndDecoding();
  111|     92|  return true;
  112|    229|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    475|                              uint32_t* out_values) {
   93|    475|  SymbolDecoderT decoder;
   94|    475|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 236, False: 239]
  ------------------
   95|    236|    return false;
   96|    236|  }
   97|       |
   98|    239|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 239, False: 0]
  |  Branch (98:25): [True: 6, False: 233]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    233|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 143, False: 90]
  ------------------
  103|    143|    return false;
  104|    143|  }
  105|  66.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 66.1M, False: 90]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  66.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  66.1M|    out_values[i] = value;
  109|  66.1M|  }
  110|     90|  decoder.EndDecoding();
  111|     90|  return true;
  112|    233|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  4.87k|    : decoder_(nullptr),
   49|  4.87k|      last_symbol_id_(-1),
   50|  4.87k|      last_vert_id_(-1),
   51|  4.87k|      last_face_id_(-1),
   52|  4.87k|      num_new_vertices_(0),
   53|  4.87k|      num_encoded_vertices_(0),
   54|  4.87k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  4.87k|    MeshEdgebreakerDecoder* decoder) {
   59|  4.87k|  decoder_ = decoder;
   60|  4.87k|  return true;
   61|  4.87k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  4.48k|    int att_id) const {
   67|  7.43k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 6.23k, False: 1.20k]
  ------------------
   68|  6.23k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  6.23k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 2.95k, False: 3.28k]
  |  Branch (69:27): [True: 0, False: 3.28k]
  ------------------
   70|  2.95k|      continue;
   71|  2.95k|    }
   72|  3.28k|    const AttributesDecoderInterface* const dec =
   73|  3.28k|        decoder_->attributes_decoder(decoder_id);
   74|  9.30k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 9.30k, False: 0]
  ------------------
   75|  9.30k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 3.28k, False: 6.02k]
  ------------------
   76|  3.28k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 2.15k, False: 1.12k]
  ------------------
   77|  2.15k|          return &attribute_data_[i].connectivity_data;
   78|  2.15k|        }
   79|  1.12k|        return nullptr;
   80|  3.28k|      }
   81|  9.30k|    }
   82|  3.28k|  }
   83|  1.20k|  return nullptr;
   84|  4.48k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  4.48k|    int att_id) const {
   90|  7.43k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 6.23k, False: 1.20k]
  ------------------
   91|  6.23k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  6.23k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 2.95k, False: 3.28k]
  |  Branch (92:27): [True: 0, False: 3.28k]
  ------------------
   93|  2.95k|      continue;
   94|  2.95k|    }
   95|  3.28k|    const AttributesDecoderInterface* const dec =
   96|  3.28k|        decoder_->attributes_decoder(decoder_id);
   97|  9.30k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 9.30k, False: 0]
  ------------------
   98|  9.30k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 3.28k, False: 6.02k]
  ------------------
   99|  3.28k|        return &attribute_data_[i].encoding_data;
  100|  3.28k|      }
  101|  9.30k|    }
  102|  3.28k|  }
  103|  1.20k|  return &pos_encoding_data_;
  104|  4.48k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  3.51k|    int32_t att_decoder_id) {
  131|  3.51k|  int8_t att_data_id;
  132|  3.51k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 39, False: 3.47k]
  ------------------
  133|     39|    return false;
  134|     39|  }
  135|  3.47k|  uint8_t decoder_type;
  136|  3.47k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 17, False: 3.45k]
  ------------------
  137|     17|    return false;
  138|     17|  }
  139|       |
  140|  3.45k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 2.40k, False: 1.05k]
  ------------------
  141|  2.40k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 88, False: 2.32k]
  ------------------
  142|     88|      return false;  // Unexpected attribute data.
  143|     88|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  2.32k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 11, False: 2.31k]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|       |
  151|  2.31k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  2.31k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|  1.05k|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 3, False: 1.04k]
  ------------------
  155|      3|      return false;  // Some other decoder is already using the data. Error.
  156|      3|    }
  157|  1.04k|    pos_data_decoder_id_ = att_decoder_id;
  158|  1.04k|  }
  159|       |
  160|  3.35k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  3.35k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  3.35k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 3.35k, False: 3]
  ------------------
  162|  3.35k|    uint8_t traversal_method_encoded;
  163|  3.35k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 10, False: 3.34k]
  ------------------
  164|     10|      return false;
  165|     10|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  3.34k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 64, False: 3.28k]
  ------------------
  168|     64|      return false;
  169|     64|    }
  170|  3.28k|    traversal_method =
  171|  3.28k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  3.28k|  }
  173|       |
  174|  3.28k|  const Mesh* mesh = decoder_->mesh();
  175|  3.28k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  3.28k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1.68k, False: 1.60k]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|  1.68k|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|  1.68k|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 977, False: 704]
  ------------------
  182|    977|      encoding_data = &pos_encoding_data_;
  183|    977|    } else {
  184|    704|      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|    704|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    704|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|  1.68k|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 319, False: 1.36k]
  ------------------
  191|    319|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    319|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    319|          AttTraverser;
  194|    319|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|  1.36k|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 1.36k, False: 0]
  ------------------
  196|  1.36k|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|  1.36k|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|  1.36k|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|  1.36k|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|  1.68k|  } else {
  203|  1.60k|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 11, False: 1.59k]
  ------------------
  204|     11|      return false;  // Unsupported method.
  205|     11|    }
  206|  1.59k|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 12, False: 1.57k]
  ------------------
  207|     12|      return false;  // Attribute data must be specified.
  208|     12|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|  1.57k|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|  1.57k|        AttObserver;
  214|  1.57k|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|  1.57k|        AttTraverser;
  216|       |
  217|  1.57k|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|  1.57k|        &attribute_data_[att_data_id].encoding_data;
  219|  1.57k|    const MeshAttributeCornerTable* const corner_table =
  220|  1.57k|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|  1.57k|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|  1.57k|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|  1.57k|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|  1.57k|                             encoding_data);
  227|       |
  228|  1.57k|    AttTraverser att_traverser;
  229|  1.57k|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|  1.57k|    traversal_sequencer->SetTraverser(att_traverser);
  232|  1.57k|    sequencer = std::move(traversal_sequencer);
  233|  1.57k|  }
  234|       |
  235|  3.26k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 3.26k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  3.26k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  3.26k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  3.26k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  3.26k|                                        std::move(att_controller));
  244|  3.26k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  4.87k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  4.87k|  num_new_vertices_ = 0;
  249|  4.87k|  new_to_parent_vertex_map_.clear();
  250|  4.87k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  4.87k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.87k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 874, False: 4.00k]
  ------------------
  252|    874|    uint32_t num_new_verts;
  253|    874|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    874|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 308, False: 566]
  ------------------
  254|    308|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 12, False: 296]
  ------------------
  255|     12|        return false;
  256|     12|      }
  257|    566|    } else {
  258|    566|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 4, False: 562]
  ------------------
  259|      4|        return false;
  260|      4|      }
  261|    566|    }
  262|    858|    num_new_vertices_ = num_new_verts;
  263|    858|  }
  264|  4.86k|#endif
  265|       |
  266|  4.86k|  uint32_t num_encoded_vertices;
  267|  4.86k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  4.86k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.86k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 296, False: 4.56k]
  ------------------
  269|    296|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 1, False: 295]
  ------------------
  270|      1|      return false;
  271|      1|    }
  272|       |
  273|    296|  } else
  274|  4.56k|#endif
  275|  4.56k|  {
  276|  4.56k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 4, False: 4.56k]
  ------------------
  277|      4|      return false;
  278|      4|    }
  279|  4.56k|  }
  280|  4.85k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  4.85k|  uint32_t num_faces;
  283|  4.85k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  4.85k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.85k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 295, False: 4.56k]
  ------------------
  285|    295|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 5, False: 290]
  ------------------
  286|      5|      return false;
  287|      5|    }
  288|       |
  289|    295|  } else
  290|  4.56k|#endif
  291|  4.56k|  {
  292|  4.56k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 4, False: 4.55k]
  ------------------
  293|      4|      return false;
  294|      4|    }
  295|  4.56k|  }
  296|  4.84k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 4, False: 4.84k]
  ------------------
  297|      4|    return false;  // Draco cannot handle this many faces.
  298|      4|  }
  299|       |
  300|  4.84k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 36, False: 4.80k]
  ------------------
  301|     36|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     36|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  4.80k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  4.80k|  const uint64_t num_encoded_vertices_64 =
  311|  4.80k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  4.80k|  const uint64_t max_num_vertex_edges =
  313|  4.80k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  4.80k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 21, False: 4.78k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     21|    return false;
  317|     21|  }
  318|       |
  319|  4.78k|  uint8_t num_attribute_data;
  320|  4.78k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 60, False: 4.72k]
  ------------------
  321|     60|    return false;
  322|     60|  }
  323|       |
  324|  4.72k|  uint32_t num_encoded_symbols;
  325|  4.72k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  4.72k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.72k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 261, False: 4.46k]
  ------------------
  327|    261|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 14, False: 247]
  ------------------
  328|     14|      return false;
  329|     14|    }
  330|       |
  331|    261|  } else
  332|  4.46k|#endif
  333|  4.46k|  {
  334|  4.46k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 8, False: 4.45k]
  ------------------
  335|      8|      return false;
  336|      8|    }
  337|  4.46k|  }
  338|       |
  339|  4.70k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 27, False: 4.67k]
  ------------------
  340|       |    // Number of faces needs to be the same or greater than the number of
  341|       |    // symbols (it can be greater because the initial face may not be encoded as
  342|       |    // a symbol).
  343|     27|    return false;
  344|     27|  }
  345|  4.67k|  const uint32_t max_encoded_faces =
  346|  4.67k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  4.67k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 59, False: 4.61k]
  ------------------
  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|     59|    return false;
  352|     59|  }
  353|       |
  354|  4.61k|  uint32_t num_encoded_split_symbols;
  355|  4.61k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  4.61k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.61k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 228, False: 4.39k]
  ------------------
  357|    228|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 5, False: 223]
  ------------------
  358|      5|      return false;
  359|      5|    }
  360|       |
  361|    228|  } else
  362|  4.39k|#endif
  363|  4.39k|  {
  364|  4.39k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 5, False: 4.38k]
  ------------------
  365|      5|      return false;
  366|      5|    }
  367|  4.39k|  }
  368|       |
  369|  4.60k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 46, False: 4.56k]
  ------------------
  370|     46|    return false;  // Split symbols are a sub-set of all symbols.
  371|     46|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  4.56k|  vertex_traversal_length_.clear();
  375|  4.56k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  4.56k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 4.56k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  4.56k|  processed_corner_ids_.clear();
  380|  4.56k|  processed_corner_ids_.reserve(num_faces);
  381|  4.56k|  processed_connectivity_corners_.clear();
  382|  4.56k|  processed_connectivity_corners_.reserve(num_faces);
  383|  4.56k|  topology_split_data_.clear();
  384|  4.56k|  hole_event_data_.clear();
  385|  4.56k|  init_face_configurations_.clear();
  386|  4.56k|  init_corners_.clear();
  387|       |
  388|  4.56k|  last_symbol_id_ = -1;
  389|  4.56k|  last_face_id_ = -1;
  390|  4.56k|  last_vert_id_ = -1;
  391|       |
  392|  4.56k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  4.56k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  4.56k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 4.56k]
  ------------------
  397|  4.56k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      1|    return false;
  399|      1|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  4.56k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  4.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  4.56k|  int32_t topology_split_decoded_bytes = -1;
  410|  4.56k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 760, False: 3.80k]
  ------------------
  411|    760|    uint32_t encoded_connectivity_size;
  412|    760|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    760|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 217, False: 543]
  ------------------
  413|    217|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 7, False: 210]
  ------------------
  414|      7|        return false;
  415|      7|      }
  416|    543|    } else {
  417|    543|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 4, False: 539]
  ------------------
  418|      4|        return false;
  419|      4|      }
  420|    543|    }
  421|    749|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 3, False: 746]
  ------------------
  422|    746|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 67, False: 679]
  ------------------
  423|     70|      return false;
  424|     70|    }
  425|    679|    DecoderBuffer event_buffer;
  426|    679|    event_buffer.Init(
  427|    679|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    679|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    679|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    679|    topology_split_decoded_bytes =
  432|    679|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    679|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 199, False: 480]
  ------------------
  434|    199|      return false;
  435|    199|    }
  436|       |
  437|    679|  } else
  438|  3.80k|#endif
  439|  3.80k|  {
  440|  3.80k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 122, False: 3.68k]
  ------------------
  441|    122|      return false;
  442|    122|    }
  443|  3.80k|  }
  444|       |
  445|  4.16k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  4.16k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  4.16k|                                           num_encoded_split_symbols);
  449|  4.16k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  4.16k|  DecoderBuffer traversal_end_buffer;
  452|  4.16k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 253, False: 3.90k]
  ------------------
  453|    253|    return false;
  454|    253|  }
  455|       |
  456|  3.90k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  3.90k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 383, False: 3.52k]
  ------------------
  458|    383|    return false;
  459|    383|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  3.52k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  3.52k|                           traversal_end_buffer.remaining_size(),
  464|  3.52k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  3.52k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  3.52k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.52k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 334, False: 3.19k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    334|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    334|  }
  471|  3.52k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  3.52k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 3.40k, False: 117]
  ------------------
  475|  3.40k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  3.40k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  3.40k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 324, False: 3.08k]
  ------------------
  477|  2.33k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 2.01k, False: 324]
  ------------------
  478|  2.01k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 2.01k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  2.01k|      }
  482|       |
  483|    324|    } else
  484|  3.08k|#endif
  485|  3.08k|    {
  486|   259k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 255k, False: 3.08k]
  ------------------
  487|   255k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 255k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   255k|      }
  491|  3.08k|    }
  492|  3.40k|  }
  493|  3.52k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  11.0k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 7.55k, False: 3.52k]
  ------------------
  498|  7.55k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  1.97M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 1.97M, False: 7.55k]
  ------------------
  501|  1.97M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  1.97M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  7.55k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 7.55k]
  ------------------
  505|  7.55k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  7.55k|  }
  509|       |
  510|  3.52k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  11.0k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 7.55k, False: 3.52k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  7.55k|    int32_t att_connectivity_verts =
  517|  7.55k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  7.55k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 447, False: 7.11k]
  ------------------
  519|    447|      att_connectivity_verts = corner_table_->num_vertices();
  520|    447|    }
  521|  7.55k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  7.55k|  }
  523|  3.52k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 12, False: 3.51k]
  ------------------
  524|     12|    return false;
  525|     12|  }
  526|  3.51k|  return true;
  527|  3.52k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|  1.02k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|  1.02k|  return true;
  532|  1.02k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  3.90k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  3.90k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  3.90k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  3.90k|  std::vector<VertexIndex> invalid_vertices;
  558|  3.90k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  3.90k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  3.90k|  int num_faces = 0;
  562|  11.9M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 11.9M, False: 3.60k]
  ------------------
  563|  11.9M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  11.9M|    bool check_topology_split = false;
  566|  11.9M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  11.9M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 5.21M, False: 6.75M]
  ------------------
  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|  5.21M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 4, False: 5.21M]
  ------------------
  588|      4|        return -1;
  589|      4|      }
  590|       |
  591|  5.21M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  5.21M|      const VertexIndex vertex_x =
  593|  5.21M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  5.21M|      const CornerIndex corner_b =
  595|  5.21M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  5.21M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 208, False: 5.21M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    208|        return -1;
  600|    208|      }
  601|  5.21M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 5.21M]
  |  Branch (601:11): [True: 0, False: 5.21M]
  ------------------
  602|  5.21M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 5.21M]
  ------------------
  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|  5.21M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  5.21M|      SetOppositeCorners(corner_a, corner + 1);
  612|  5.21M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  5.21M|      const VertexIndex vert_a_prev =
  616|  5.21M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  5.21M|      const VertexIndex vert_b_next =
  618|  5.21M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  5.21M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 5.21M]
  |  Branch (619:38): [True: 0, False: 5.21M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  5.21M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  5.21M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  5.21M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  5.21M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  5.21M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  5.21M|      active_corner_stack.back() = corner;
  631|  6.75M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 2.28M, False: 4.47M]
  |  Branch (631:40): [True: 819k, False: 3.65M]
  ------------------
  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|  3.10M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 2, False: 3.10M]
  ------------------
  647|      2|        return -1;
  648|      2|      }
  649|  3.10M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  3.10M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 3.10M]
  ------------------
  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|  3.10M|      const CornerIndex corner(3 * face.value());
  658|  3.10M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  3.10M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 2.28M, False: 819k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  2.28M|        opp_corner = corner + 2;
  662|  2.28M|        corner_l = corner + 1;
  663|  2.28M|        corner_r = corner;
  664|  2.28M|      } else {
  665|       |        // "l" is the new first corner.
  666|   819k|        opp_corner = corner + 1;
  667|   819k|        corner_l = corner;
  668|   819k|        corner_r = corner + 2;
  669|   819k|      }
  670|  3.10M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  3.10M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  3.10M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 1, False: 3.10M]
  ------------------
  675|      1|        return -1;  // Unexpected number of decoded vertices.
  676|      1|      }
  677|       |
  678|  3.10M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  3.10M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  3.10M|      const VertexIndex vertex_r =
  682|  3.10M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  3.10M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  3.10M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  3.10M|      corner_table_->MapCornerToVertex(
  688|  3.10M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  3.10M|      active_corner_stack.back() = corner;
  690|  3.10M|      check_topology_split = true;
  691|  3.65M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 1.17M, False: 2.47M]
  ------------------
  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.17M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 2, False: 1.17M]
  ------------------
  703|      2|        return -1;
  704|      2|      }
  705|  1.17M|      const CornerIndex corner_b = active_corner_stack.back();
  706|  1.17M|      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.17M|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  1.17M|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 67, False: 1.17M]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     67|        active_corner_stack.push_back(it->second);
  714|     67|      }
  715|  1.17M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 22, False: 1.17M]
  ------------------
  716|     22|        return -1;
  717|     22|      }
  718|  1.17M|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  1.17M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 1.17M]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  1.17M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 13, False: 1.17M]
  |  Branch (724:11): [True: 13, False: 1.17M]
  ------------------
  725|  1.17M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 1.17M]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|     13|        return -1;
  729|     13|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  1.17M|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  1.17M|      SetOppositeCorners(corner_a, corner + 2);
  735|  1.17M|      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.17M|      const VertexIndex vertex_p =
  739|  1.17M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  1.17M|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  1.17M|      corner_table_->MapCornerToVertex(
  742|  1.17M|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  1.17M|      const VertexIndex vert_b_prev =
  744|  1.17M|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  1.17M|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  1.17M|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  1.17M|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  1.17M|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  1.17M|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  1.17M|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  1.17M|                                       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.17M|      const CornerIndex first_corner = corner_n;
  757|  8.11M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 6.93M, False: 1.17M]
  ------------------
  758|  6.93M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  6.93M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  6.93M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 2, False: 6.93M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      2|          return -1;
  764|      2|        }
  765|  6.93M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  1.17M|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  1.17M|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 21.7k, False: 1.15M]
  ------------------
  770|  21.7k|        invalid_vertices.push_back(vertex_n);
  771|  21.7k|      }
  772|  1.17M|      active_corner_stack.back() = corner;
  773|  2.47M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 2.47M, False: 0]
  ------------------
  774|  2.47M|      const CornerIndex corner(3 * face.value());
  775|  2.47M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  2.47M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  2.47M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  2.47M|                                       corner_table_->AddNewVertex());
  780|  2.47M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  2.47M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  2.47M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 4, False: 2.47M]
  ------------------
  784|      4|        return -1;  // Unexpected number of decoded vertices.
  785|      4|      }
  786|       |
  787|  2.47M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  2.47M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  2.47M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  2.47M|      active_corner_stack.push_back(corner);
  792|  2.47M|      check_topology_split = true;
  793|  2.47M|    } 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|  11.9M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  11.9M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 5.58M, False: 6.39M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  5.58M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  5.58M|      EdgeFaceName split_edge;
  812|  5.58M|      int encoder_split_symbol_id;
  813|  5.58M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 2.44k, False: 5.58M]
  ------------------
  814|  5.58M|                             &encoder_split_symbol_id)) {
  815|  2.44k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 45, False: 2.40k]
  ------------------
  816|     45|          return -1;  // Wrong split symbol id.
  817|     45|        }
  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|  2.40k|        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|  2.40k|        CornerIndex new_active_corner;
  831|  2.40k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 875, False: 1.52k]
  ------------------
  832|    875|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.52k|        } else {
  834|  1.52k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.52k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  2.40k|        const int decoder_split_symbol_id =
  839|  2.40k|            num_symbols - encoder_split_symbol_id - 1;
  840|  2.40k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  2.40k|            new_active_corner;
  842|  2.40k|      }
  843|  5.58M|    }
  844|  11.9M|  }
  845|  3.60k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 3.60k]
  ------------------
  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|  41.1k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 37.5k, False: 3.57k]
  ------------------
  850|  37.5k|    const CornerIndex corner = active_corner_stack.back();
  851|  37.5k|    active_corner_stack.pop_back();
  852|  37.5k|    const bool interior_face =
  853|  37.5k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  37.5k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 25.8k, False: 11.6k]
  ------------------
  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|  25.8k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 10, False: 25.8k]
  ------------------
  877|     10|        return -1;  // More faces than expected added to the mesh.
  878|     10|      }
  879|       |
  880|  25.8k|      const CornerIndex corner_a = corner;
  881|  25.8k|      const VertexIndex vert_n =
  882|  25.8k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  25.8k|      const CornerIndex corner_b =
  884|  25.8k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  25.8k|      const VertexIndex vert_x =
  887|  25.8k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  25.8k|      const CornerIndex corner_c =
  889|  25.8k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  25.8k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 11, False: 25.8k]
  |  Branch (891:33): [True: 9, False: 25.8k]
  |  Branch (891:55): [True: 0, False: 25.8k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     20|        return -1;
  894|     20|      }
  895|  25.8k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 2, False: 25.8k]
  |  Branch (895:11): [True: 2, False: 25.8k]
  ------------------
  896|  25.8k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 25.8k]
  ------------------
  897|  25.8k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 25.8k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      2|        return -1;
  901|      2|      }
  902|       |
  903|  25.8k|      const VertexIndex vert_p =
  904|  25.8k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  25.8k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  25.8k|      const CornerIndex new_corner(3 * face.value());
  909|  25.8k|      SetOppositeCorners(new_corner, corner);
  910|  25.8k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  25.8k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  25.8k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  25.8k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  25.8k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|   103k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 77.5k, False: 25.8k]
  ------------------
  920|  77.5k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  77.5k|      }
  922|       |
  923|  25.8k|      init_face_configurations_.push_back(true);
  924|  25.8k|      init_corners_.push_back(new_corner);
  925|  25.8k|    } 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|  11.6k|      init_face_configurations_.push_back(false);
  930|  11.6k|      init_corners_.push_back(corner);
  931|  11.6k|    }
  932|  37.5k|  }
  933|  3.57k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 47, False: 3.52k]
  ------------------
  934|     47|    return -1;  // Unexpected number of decoded faces.
  935|     47|  }
  936|       |
  937|  3.52k|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  3.52k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 804, False: 3.52k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    804|    VertexIndex src_vert(num_vertices - 1);
  943|    958|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 154, False: 804]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    154|      src_vert = VertexIndex(--num_vertices - 1);
  946|    154|    }
  947|    804|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 154, False: 650]
  ------------------
  948|    154|      continue;  // No need to swap anything.
  949|    154|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    650|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  4.23k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 3.58k, False: 649]
  ------------------
  954|  3.58k|      const CornerIndex cid = vcit.Corner();
  955|  3.58k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 1, False: 3.58k]
  ------------------
  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|  3.58k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  3.58k|    }
  962|    649|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    649|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    649|    corner_table_->MakeVertexIsolated(src_vert);
  967|    649|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    649|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    649|    num_vertices--;
  972|    649|  }
  973|  3.52k|  return num_vertices;
  974|  3.52k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  4.48k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  4.48k|  uint32_t num_topology_splits;
  982|  4.48k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  4.48k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 171, False: 4.31k]
  ------------------
  984|    171|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 170]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    171|  } else
  989|  4.31k|#endif
  990|  4.31k|  {
  991|  4.31k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 15, False: 4.29k]
  ------------------
  992|     15|      return -1;
  993|     15|    }
  994|  4.31k|  }
  995|  4.46k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 2.36k, False: 2.10k]
  ------------------
  996|  2.36k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 76, False: 2.28k]
  ------------------
  997|  2.36k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     76|      return -1;
  999|     76|    }
 1000|  2.28k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  2.28k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  2.28k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 82, False: 2.20k]
  ------------------
 1002|   104k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 104k, False: 26]
  ------------------
 1003|   104k|        TopologySplitEventData event_data;
 1004|   104k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 35, False: 104k]
  ------------------
 1005|     35|          return -1;
 1006|     35|        }
 1007|   104k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 17, False: 104k]
  ------------------
 1008|     17|          return -1;
 1009|     17|        }
 1010|   104k|        uint8_t edge_data;
 1011|   104k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 104k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|   104k|        event_data.source_edge = edge_data & 1;
 1015|   104k|        topology_split_data_.push_back(event_data);
 1016|   104k|      }
 1017|       |
 1018|     82|    } else
 1019|  2.20k|#endif
 1020|  2.20k|    {
 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|  2.20k|      int last_source_symbol_id = 0;
 1024|  8.73k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 6.59k, False: 2.14k]
  ------------------
 1025|  6.59k|        TopologySplitEventData event_data;
 1026|  6.59k|        uint32_t delta;
 1027|  6.59k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 22, False: 6.57k]
  ------------------
 1028|     22|          return -1;
 1029|     22|        }
 1030|  6.57k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  6.57k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 10, False: 6.56k]
  ------------------
 1032|     10|          return -1;
 1033|     10|        }
 1034|  6.56k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 28, False: 6.53k]
  ------------------
 1035|     28|          return -1;
 1036|     28|        }
 1037|  6.53k|        event_data.split_symbol_id =
 1038|  6.53k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  6.53k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  6.53k|        topology_split_data_.push_back(event_data);
 1041|  6.53k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  2.14k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  7.89k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 5.75k, False: 2.14k]
  ------------------
 1045|  5.75k|        uint32_t edge_data;
 1046|  5.75k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.75k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.04k, False: 4.70k]
  ------------------
 1047|  1.04k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  4.70k|        } else {
 1049|  4.70k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  4.70k|        }
 1051|  5.75k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  5.75k|        event_data.source_edge = edge_data & 1;
 1053|  5.75k|      }
 1054|  2.14k|      decoder_buffer->EndBitDecoding();
 1055|  2.14k|    }
 1056|  2.28k|  }
 1057|  4.27k|  uint32_t num_hole_events = 0;
 1058|  4.27k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  4.27k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.27k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 93, False: 4.18k]
  ------------------
 1060|     93|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 7, False: 86]
  ------------------
 1061|      7|      return -1;
 1062|      7|    }
 1063|  4.18k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  4.18k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 474, False: 3.70k]
  ------------------
 1064|    474|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 11, False: 463]
  ------------------
 1065|     11|      return -1;
 1066|     11|    }
 1067|    474|  }
 1068|  4.25k|#endif
 1069|  4.25k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 105, False: 4.15k]
  ------------------
 1070|    105|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|    105|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    105|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 60, False: 45]
  ------------------
 1072|   343k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 343k, False: 1]
  ------------------
 1073|   343k|        HoleEventData event_data;
 1074|   343k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 59, False: 343k]
  ------------------
 1075|     59|          return -1;
 1076|     59|        }
 1077|   343k|        hole_event_data_.push_back(event_data);
 1078|   343k|      }
 1079|       |
 1080|     60|    } else
 1081|     45|#endif
 1082|     45|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     45|      int last_symbol_id = 0;
 1085|   296k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 296k, False: 9]
  ------------------
 1086|   296k|        HoleEventData event_data;
 1087|   296k|        uint32_t delta;
 1088|   296k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 36, False: 296k]
  ------------------
 1089|     36|          return -1;
 1090|     36|        }
 1091|   296k|        event_data.symbol_id = delta + last_symbol_id;
 1092|   296k|        last_symbol_id = event_data.symbol_id;
 1093|   296k|        hole_event_data_.push_back(event_data);
 1094|   296k|      }
 1095|     45|    }
 1096|    105|  }
 1097|  4.16k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  4.25k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  2.01k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  2.01k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  2.01k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  8.05k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 6.03k, False: 2.01k]
  ------------------
 1109|  6.03k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  6.03k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.69k, False: 4.34k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  3.39k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.69k, False: 1.69k]
  ------------------
 1114|  1.69k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.69k|      }
 1116|  1.69k|      continue;
 1117|  1.69k|    }
 1118|       |
 1119|  8.68k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 4.34k, False: 4.34k]
  ------------------
 1120|  4.34k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  4.34k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 3.59k, False: 747]
  ------------------
 1122|  3.59k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  3.59k|      }
 1124|  4.34k|    }
 1125|  4.34k|  }
 1126|  2.01k|  return true;
 1127|  2.01k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   255k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   255k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   255k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   255k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.02M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 767k, False: 255k]
  ------------------
 1139|   767k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   767k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 34.2k, False: 733k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   166k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 132k, False: 34.2k]
  ------------------
 1144|   132k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   132k|      }
 1146|  34.2k|      continue;
 1147|  34.2k|    }
 1148|   733k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   733k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 366k, False: 366k]
  ------------------
 1151|   366k|      continue;
 1152|   366k|    }
 1153|       |
 1154|  2.46M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 2.09M, False: 366k]
  ------------------
 1155|  2.09M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  2.09M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 1.83M, False: 261k]
  ------------------
 1157|  1.83M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  1.83M|      }
 1159|  2.09M|    }
 1160|   366k|  }
 1161|   255k|  return true;
 1162|   255k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  3.52k|    int num_connectivity_verts) {
 1167|       |  // Map between the existing and deduplicated point ids.
 1168|       |  // Note that at this point we have one point id for each corner of the
 1169|       |  // mesh so there is corner_table_->num_corners() point ids.
 1170|  3.52k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  3.52k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 117, False: 3.40k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  6.46k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 6.34k, False: 117]
  ------------------
 1176|  6.34k|      Mesh::Face face;
 1177|  6.34k|      const CornerIndex start_corner(3 * f.value());
 1178|  25.3k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 19.0k, False: 6.34k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  19.0k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  19.0k|        face[c] = vert_id;
 1182|  19.0k|      }
 1183|  6.34k|      decoder_->mesh()->SetFace(f, face);
 1184|  6.34k|    }
 1185|    117|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|    117|    return true;
 1187|    117|  }
 1188|       |  // Else we need to deduplicate multiple attributes.
 1189|       |
 1190|       |  // Map between point id and an associated corner id. Only one corner for
 1191|       |  // each point is stored. The corners are used to sample the attribute values
 1192|       |  // in the last stage of the deduplication.
 1193|  3.40k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  3.40k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   150k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 147k, False: 3.39k]
  ------------------
 1197|   147k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   147k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 6.69k, False: 140k]
  ------------------
 1199|  6.69k|      continue;  // Isolated vertex.
 1200|  6.69k|    }
 1201|   140k|    CornerIndex deduplication_first_corner = c;
 1202|   140k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 35.5k, False: 105k]
  ------------------
 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.5k|      deduplication_first_corner = c;
 1206|   105k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   117k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 112k, False: 4.90k]
  ------------------
 1210|   112k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 7.44k, False: 105k]
  ------------------
 1211|  7.44k|          continue;  // No seam for this attribute, ignore it.
 1212|  7.44k|        }
 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|   105k|        const VertexIndex vert_id =
 1217|   105k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   105k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   105k|        bool seam_found = false;
 1220|   114k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 109k, False: 4.81k]
  ------------------
 1221|   109k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 12, False: 109k]
  ------------------
 1222|     12|            return false;
 1223|     12|          }
 1224|   109k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 100k, False: 9.24k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   100k|            deduplication_first_corner = act_c;
 1227|   100k|            seam_found = true;
 1228|   100k|            break;
 1229|   100k|          }
 1230|  9.24k|          act_c = corner_table_->SwingRight(act_c);
 1231|  9.24k|        }
 1232|   105k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 100k, False: 4.81k]
  ------------------
 1233|   100k|          break;  // No reason to process other attributes if we found a seam.
 1234|   100k|        }
 1235|   105k|      }
 1236|   105k|    }
 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|   140k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   140k|    corner_to_point_map[c.value()] =
 1246|   140k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   140k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   140k|    CornerIndex prev_c = c;
 1250|   140k|    c = corner_table_->SwingRight(c);
 1251|   718k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 683k, False: 35.6k]
  |  Branch (1251:40): [True: 578k, False: 105k]
  ------------------
 1252|   578k|      bool attribute_seam = false;
 1253|   638k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 612k, False: 26.3k]
  ------------------
 1254|   612k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 551k, False: 60.7k]
  ------------------
 1255|   612k|            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|   551k|          attribute_seam = true;
 1259|   551k|          break;
 1260|   551k|        }
 1261|   612k|      }
 1262|   578k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 551k, False: 26.3k]
  ------------------
 1263|   551k|        corner_to_point_map[c.value()] =
 1264|   551k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   551k|        point_to_corner_map.push_back(c.value());
 1266|   551k|      } else {
 1267|  26.3k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  26.3k|      }
 1269|   578k|      prev_c = c;
 1270|   578k|      c = corner_table_->SwingRight(c);
 1271|   578k|    }
 1272|   140k|  }
 1273|       |  // Add faces.
 1274|   223k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 220k, False: 3.39k]
  ------------------
 1275|   220k|    Mesh::Face face;
 1276|   881k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 661k, False: 220k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   661k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   661k|    }
 1280|   220k|    decoder_->mesh()->SetFace(f, face);
 1281|   220k|  }
 1282|  3.39k|  decoder_->point_cloud()->set_num_points(
 1283|  3.39k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  3.39k|  return true;
 1285|  3.40k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  3.51k|    : decoder_(nullptr),
   49|  3.51k|      last_symbol_id_(-1),
   50|  3.51k|      last_vert_id_(-1),
   51|  3.51k|      last_face_id_(-1),
   52|  3.51k|      num_new_vertices_(0),
   53|  3.51k|      num_encoded_vertices_(0),
   54|  3.51k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  3.51k|    MeshEdgebreakerDecoder* decoder) {
   59|  3.51k|  decoder_ = decoder;
   60|  3.51k|  return true;
   61|  3.51k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  2.56k|    int att_id) const {
   67|  3.81k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 3.06k, False: 742]
  ------------------
   68|  3.06k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  3.06k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.24k, False: 1.82k]
  |  Branch (69:27): [True: 0, False: 1.82k]
  ------------------
   70|  1.24k|      continue;
   71|  1.24k|    }
   72|  1.82k|    const AttributesDecoderInterface* const dec =
   73|  1.82k|        decoder_->attributes_decoder(decoder_id);
   74|  5.06k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 5.06k, False: 0]
  ------------------
   75|  5.06k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.82k, False: 3.24k]
  ------------------
   76|  1.82k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.15k, False: 663]
  ------------------
   77|  1.15k|          return &attribute_data_[i].connectivity_data;
   78|  1.15k|        }
   79|    663|        return nullptr;
   80|  1.82k|      }
   81|  5.06k|    }
   82|  1.82k|  }
   83|    742|  return nullptr;
   84|  2.56k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  2.56k|    int att_id) const {
   90|  3.81k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 3.06k, False: 742]
  ------------------
   91|  3.06k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  3.06k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.24k, False: 1.82k]
  |  Branch (92:27): [True: 0, False: 1.82k]
  ------------------
   93|  1.24k|      continue;
   94|  1.24k|    }
   95|  1.82k|    const AttributesDecoderInterface* const dec =
   96|  1.82k|        decoder_->attributes_decoder(decoder_id);
   97|  5.06k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 5.06k, False: 0]
  ------------------
   98|  5.06k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.82k, False: 3.24k]
  ------------------
   99|  1.82k|        return &attribute_data_[i].encoding_data;
  100|  1.82k|      }
  101|  5.06k|    }
  102|  1.82k|  }
  103|    742|  return &pos_encoding_data_;
  104|  2.56k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  2.30k|    int32_t att_decoder_id) {
  131|  2.30k|  int8_t att_data_id;
  132|  2.30k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 65, False: 2.24k]
  ------------------
  133|     65|    return false;
  134|     65|  }
  135|  2.24k|  uint8_t decoder_type;
  136|  2.24k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 24, False: 2.22k]
  ------------------
  137|     24|    return false;
  138|     24|  }
  139|       |
  140|  2.22k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.59k, False: 628]
  ------------------
  141|  1.59k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 61, False: 1.53k]
  ------------------
  142|     61|      return false;  // Unexpected attribute data.
  143|     61|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.53k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 7, False: 1.52k]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|       |
  151|  1.52k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.52k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    628|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 626]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|    626|    pos_data_decoder_id_ = att_decoder_id;
  158|    626|  }
  159|       |
  160|  2.15k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  2.15k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  2.15k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 2.15k, False: 0]
  ------------------
  162|  2.15k|    uint8_t traversal_method_encoded;
  163|  2.15k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 13, False: 2.13k]
  ------------------
  164|     13|      return false;
  165|     13|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  2.13k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 18, False: 2.11k]
  ------------------
  168|     18|      return false;
  169|     18|    }
  170|  2.11k|    traversal_method =
  171|  2.11k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  2.11k|  }
  173|       |
  174|  2.11k|  const Mesh* mesh = decoder_->mesh();
  175|  2.11k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  2.11k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1.10k, False: 1.01k]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|  1.10k|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|  1.10k|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 601, False: 505]
  ------------------
  182|    601|      encoding_data = &pos_encoding_data_;
  183|    601|    } else {
  184|    505|      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|    505|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    505|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|  1.10k|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 361, False: 745]
  ------------------
  191|    361|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    361|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    361|          AttTraverser;
  194|    361|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    745|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 745, False: 0]
  ------------------
  196|    745|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    745|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    745|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    745|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|  1.10k|  } else {
  203|  1.01k|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 5, False: 1.00k]
  ------------------
  204|      5|      return false;  // Unsupported method.
  205|      5|    }
  206|  1.00k|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 11, False: 997]
  ------------------
  207|     11|      return false;  // Attribute data must be specified.
  208|     11|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    997|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    997|        AttObserver;
  214|    997|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    997|        AttTraverser;
  216|       |
  217|    997|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|    997|        &attribute_data_[att_data_id].encoding_data;
  219|    997|    const MeshAttributeCornerTable* const corner_table =
  220|    997|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    997|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    997|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    997|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    997|                             encoding_data);
  227|       |
  228|    997|    AttTraverser att_traverser;
  229|    997|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    997|    traversal_sequencer->SetTraverser(att_traverser);
  232|    997|    sequencer = std::move(traversal_sequencer);
  233|    997|  }
  234|       |
  235|  2.10k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 2.10k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  2.10k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  2.10k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  2.10k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  2.10k|                                        std::move(att_controller));
  244|  2.10k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  3.51k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  3.51k|  num_new_vertices_ = 0;
  249|  3.51k|  new_to_parent_vertex_map_.clear();
  250|  3.51k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  3.51k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.51k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 370, False: 3.14k]
  ------------------
  252|    370|    uint32_t num_new_verts;
  253|    370|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    370|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 254, False: 116]
  ------------------
  254|    254|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 10, False: 244]
  ------------------
  255|     10|        return false;
  256|     10|      }
  257|    254|    } else {
  258|    116|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 2, False: 114]
  ------------------
  259|      2|        return false;
  260|      2|      }
  261|    116|    }
  262|    358|    num_new_vertices_ = num_new_verts;
  263|    358|  }
  264|  3.50k|#endif
  265|       |
  266|  3.50k|  uint32_t num_encoded_vertices;
  267|  3.50k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  3.50k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 244, False: 3.25k]
  ------------------
  269|    244|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 5, False: 239]
  ------------------
  270|      5|      return false;
  271|      5|    }
  272|       |
  273|    244|  } else
  274|  3.25k|#endif
  275|  3.25k|  {
  276|  3.25k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 3, False: 3.25k]
  ------------------
  277|      3|      return false;
  278|      3|    }
  279|  3.25k|  }
  280|  3.49k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  3.49k|  uint32_t num_faces;
  283|  3.49k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  3.49k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.49k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 239, False: 3.25k]
  ------------------
  285|    239|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 4, False: 235]
  ------------------
  286|      4|      return false;
  287|      4|    }
  288|       |
  289|    239|  } else
  290|  3.25k|#endif
  291|  3.25k|  {
  292|  3.25k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 1, False: 3.25k]
  ------------------
  293|      1|      return false;
  294|      1|    }
  295|  3.25k|  }
  296|  3.48k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 2, False: 3.48k]
  ------------------
  297|      2|    return false;  // Draco cannot handle this many faces.
  298|      2|  }
  299|       |
  300|  3.48k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 36, False: 3.45k]
  ------------------
  301|     36|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     36|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  3.45k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  3.45k|  const uint64_t num_encoded_vertices_64 =
  311|  3.45k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  3.45k|  const uint64_t max_num_vertex_edges =
  313|  3.45k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  3.45k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 24, False: 3.42k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     24|    return false;
  317|     24|  }
  318|       |
  319|  3.42k|  uint8_t num_attribute_data;
  320|  3.42k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 49, False: 3.37k]
  ------------------
  321|     49|    return false;
  322|     49|  }
  323|       |
  324|  3.37k|  uint32_t num_encoded_symbols;
  325|  3.37k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  3.37k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.37k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 209, False: 3.16k]
  ------------------
  327|    209|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 20, False: 189]
  ------------------
  328|     20|      return false;
  329|     20|    }
  330|       |
  331|    209|  } else
  332|  3.16k|#endif
  333|  3.16k|  {
  334|  3.16k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 5, False: 3.16k]
  ------------------
  335|      5|      return false;
  336|      5|    }
  337|  3.16k|  }
  338|       |
  339|  3.35k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 26, False: 3.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|     26|    return false;
  344|     26|  }
  345|  3.32k|  const uint32_t max_encoded_faces =
  346|  3.32k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  3.32k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 61, False: 3.26k]
  ------------------
  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|     61|    return false;
  352|     61|  }
  353|       |
  354|  3.26k|  uint32_t num_encoded_split_symbols;
  355|  3.26k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  3.26k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.26k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 166, False: 3.10k]
  ------------------
  357|    166|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 1, False: 165]
  ------------------
  358|      1|      return false;
  359|      1|    }
  360|       |
  361|    166|  } else
  362|  3.10k|#endif
  363|  3.10k|  {
  364|  3.10k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 4, False: 3.09k]
  ------------------
  365|      4|      return false;
  366|      4|    }
  367|  3.10k|  }
  368|       |
  369|  3.26k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 40, False: 3.22k]
  ------------------
  370|     40|    return false;  // Split symbols are a sub-set of all symbols.
  371|     40|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  3.22k|  vertex_traversal_length_.clear();
  375|  3.22k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  3.22k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 3.22k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  3.22k|  processed_corner_ids_.clear();
  380|  3.22k|  processed_corner_ids_.reserve(num_faces);
  381|  3.22k|  processed_connectivity_corners_.clear();
  382|  3.22k|  processed_connectivity_corners_.reserve(num_faces);
  383|  3.22k|  topology_split_data_.clear();
  384|  3.22k|  hole_event_data_.clear();
  385|  3.22k|  init_face_configurations_.clear();
  386|  3.22k|  init_corners_.clear();
  387|       |
  388|  3.22k|  last_symbol_id_ = -1;
  389|  3.22k|  last_face_id_ = -1;
  390|  3.22k|  last_vert_id_ = -1;
  391|       |
  392|  3.22k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  3.22k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  3.22k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 3.22k]
  ------------------
  397|  3.22k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      1|    return false;
  399|      1|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  3.22k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  3.22k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  3.22k|  int32_t topology_split_decoded_bytes = -1;
  410|  3.22k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.22k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 262, False: 2.95k]
  ------------------
  411|    262|    uint32_t encoded_connectivity_size;
  412|    262|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    262|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 161, False: 101]
  ------------------
  413|    161|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 7, False: 154]
  ------------------
  414|      7|        return false;
  415|      7|      }
  416|    161|    } else {
  417|    101|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 3, False: 98]
  ------------------
  418|      3|        return false;
  419|      3|      }
  420|    101|    }
  421|    252|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 251]
  ------------------
  422|    251|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 50, False: 201]
  ------------------
  423|     51|      return false;
  424|     51|    }
  425|    201|    DecoderBuffer event_buffer;
  426|    201|    event_buffer.Init(
  427|    201|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    201|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    201|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    201|    topology_split_decoded_bytes =
  432|    201|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    201|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 146, False: 55]
  ------------------
  434|    146|      return false;
  435|    146|    }
  436|       |
  437|    201|  } else
  438|  2.95k|#endif
  439|  2.95k|  {
  440|  2.95k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 150, False: 2.80k]
  ------------------
  441|    150|      return false;
  442|    150|    }
  443|  2.95k|  }
  444|       |
  445|  2.86k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.86k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.86k|                                           num_encoded_split_symbols);
  449|  2.86k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.86k|  DecoderBuffer traversal_end_buffer;
  452|  2.86k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 217, False: 2.64k]
  ------------------
  453|    217|    return false;
  454|    217|  }
  455|       |
  456|  2.64k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  2.64k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 238, False: 2.40k]
  ------------------
  458|    238|    return false;
  459|    238|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  2.40k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  2.40k|                           traversal_end_buffer.remaining_size(),
  464|  2.40k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  2.40k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  2.40k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.40k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 16, False: 2.39k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|     16|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|     16|  }
  471|  2.40k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  2.40k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 2.37k, False: 35]
  ------------------
  475|  2.37k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  2.37k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.37k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 16, False: 2.35k]
  ------------------
  477|  1.72k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.71k, False: 16]
  ------------------
  478|  1.71k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.71k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.71k|      }
  482|       |
  483|     16|    } else
  484|  2.35k|#endif
  485|  2.35k|    {
  486|  15.6M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 15.6M, False: 2.35k]
  ------------------
  487|  15.6M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 15.6M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  15.6M|      }
  491|  2.35k|    }
  492|  2.37k|  }
  493|  2.40k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  5.23k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 2.82k, False: 2.40k]
  ------------------
  498|  2.82k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  22.1M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 22.1M, False: 2.82k]
  ------------------
  501|  22.1M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  22.1M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  2.82k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 2.82k]
  ------------------
  505|  2.82k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  2.82k|  }
  509|       |
  510|  2.40k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  5.23k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 2.82k, False: 2.40k]
  ------------------
  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.82k|    int32_t att_connectivity_verts =
  517|  2.82k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  2.82k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 176, False: 2.65k]
  ------------------
  519|    176|      att_connectivity_verts = corner_table_->num_vertices();
  520|    176|    }
  521|  2.82k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  2.82k|  }
  523|  2.40k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 16, False: 2.39k]
  ------------------
  524|     16|    return false;
  525|     16|  }
  526|  2.39k|  return true;
  527|  2.40k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    860|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    860|  return true;
  532|    860|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  2.64k|    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|  2.64k|  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|  2.64k|  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|  2.64k|  std::vector<VertexIndex> invalid_vertices;
  558|  2.64k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  2.64k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  2.64k|  int num_faces = 0;
  562|  70.6M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 70.6M, False: 2.52k]
  ------------------
  563|  70.6M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  70.6M|    bool check_topology_split = false;
  566|  70.6M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  70.6M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 35.1M, False: 35.5M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  35.1M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 2, False: 35.1M]
  ------------------
  588|      2|        return -1;
  589|      2|      }
  590|       |
  591|  35.1M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  35.1M|      const VertexIndex vertex_x =
  593|  35.1M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  35.1M|      const CornerIndex corner_b =
  595|  35.1M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  35.1M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 61, False: 35.1M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     61|        return -1;
  600|     61|      }
  601|  35.1M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 35.1M]
  |  Branch (601:11): [True: 0, False: 35.1M]
  ------------------
  602|  35.1M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 35.1M]
  ------------------
  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|  35.1M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  35.1M|      SetOppositeCorners(corner_a, corner + 1);
  612|  35.1M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  35.1M|      const VertexIndex vert_a_prev =
  616|  35.1M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  35.1M|      const VertexIndex vert_b_next =
  618|  35.1M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  35.1M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 35.1M]
  |  Branch (619:38): [True: 0, False: 35.1M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  35.1M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  35.1M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  35.1M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  35.1M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  35.1M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  35.1M|      active_corner_stack.back() = corner;
  631|  35.5M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 35.4M, False: 42.9k]
  |  Branch (631:40): [True: 8.82k, False: 34.1k]
  ------------------
  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|  35.4M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 35.4M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  35.4M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  35.4M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 35.4M]
  ------------------
  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|  35.4M|      const CornerIndex corner(3 * face.value());
  658|  35.4M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  35.4M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 35.4M, False: 8.82k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  35.4M|        opp_corner = corner + 2;
  662|  35.4M|        corner_l = corner + 1;
  663|  35.4M|        corner_r = corner;
  664|  35.4M|      } else {
  665|       |        // "l" is the new first corner.
  666|  8.82k|        opp_corner = corner + 1;
  667|  8.82k|        corner_l = corner;
  668|  8.82k|        corner_r = corner + 2;
  669|  8.82k|      }
  670|  35.4M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  35.4M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  35.4M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 10, False: 35.4M]
  ------------------
  675|     10|        return -1;  // Unexpected number of decoded vertices.
  676|     10|      }
  677|       |
  678|  35.4M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  35.4M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  35.4M|      const VertexIndex vertex_r =
  682|  35.4M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  35.4M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  35.4M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  35.4M|      corner_table_->MapCornerToVertex(
  688|  35.4M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  35.4M|      active_corner_stack.back() = corner;
  690|  35.4M|      check_topology_split = true;
  691|  35.4M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 10.4k, False: 23.6k]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  10.4k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 10.4k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  10.4k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  10.4k|      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|  10.4k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  10.4k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 30, False: 10.4k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     30|        active_corner_stack.push_back(it->second);
  714|     30|      }
  715|  10.4k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 15, False: 10.4k]
  ------------------
  716|     15|        return -1;
  717|     15|      }
  718|  10.4k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  10.4k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 10.4k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  10.4k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 10, False: 10.4k]
  |  Branch (724:11): [True: 10, False: 10.4k]
  ------------------
  725|  10.4k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 10.4k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|     10|        return -1;
  729|     10|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  10.4k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  10.4k|      SetOppositeCorners(corner_a, corner + 2);
  735|  10.4k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  10.4k|      const VertexIndex vertex_p =
  739|  10.4k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  10.4k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  10.4k|      corner_table_->MapCornerToVertex(
  742|  10.4k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  10.4k|      const VertexIndex vert_b_prev =
  744|  10.4k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  10.4k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  10.4k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  10.4k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  10.4k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  10.4k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  10.4k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  10.4k|                                       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|  10.4k|      const CornerIndex first_corner = corner_n;
  757|  42.0k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 31.6k, False: 10.4k]
  ------------------
  758|  31.6k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  31.6k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  31.6k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 31.6k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  31.6k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  10.4k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  10.4k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 4.16k, False: 6.25k]
  ------------------
  770|  4.16k|        invalid_vertices.push_back(vertex_n);
  771|  4.16k|      }
  772|  10.4k|      active_corner_stack.back() = corner;
  773|  23.6k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 23.6k, False: 0]
  ------------------
  774|  23.6k|      const CornerIndex corner(3 * face.value());
  775|  23.6k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  23.6k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  23.6k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  23.6k|                                       corner_table_->AddNewVertex());
  780|  23.6k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  23.6k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  23.6k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 23.6k]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  23.6k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  23.6k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  23.6k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  23.6k|      active_corner_stack.push_back(corner);
  792|  23.6k|      check_topology_split = true;
  793|  23.6k|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      0|      return -1;
  796|      0|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  70.6M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  70.6M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 35.4M, False: 35.1M]
  ------------------
  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|  35.4M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  35.4M|      EdgeFaceName split_edge;
  812|  35.4M|      int encoder_split_symbol_id;
  813|  35.5M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.45k, False: 35.4M]
  ------------------
  814|  35.5M|                             &encoder_split_symbol_id)) {
  815|  1.45k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 18, False: 1.43k]
  ------------------
  816|     18|          return -1;  // Wrong split symbol id.
  817|     18|        }
  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.43k|        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.43k|        CornerIndex new_active_corner;
  831|  1.43k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 553, False: 879]
  ------------------
  832|    553|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    879|        } else {
  834|    879|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    879|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.43k|        const int decoder_split_symbol_id =
  839|  1.43k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.43k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.43k|            new_active_corner;
  842|  1.43k|      }
  843|  35.4M|    }
  844|  70.6M|  }
  845|  2.52k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 2.52k]
  ------------------
  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|  12.7k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 10.2k, False: 2.49k]
  ------------------
  850|  10.2k|    const CornerIndex corner = active_corner_stack.back();
  851|  10.2k|    active_corner_stack.pop_back();
  852|  10.2k|    const bool interior_face =
  853|  10.2k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  10.2k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 6.34k, False: 3.87k]
  ------------------
  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|  6.34k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 12, False: 6.32k]
  ------------------
  877|     12|        return -1;  // More faces than expected added to the mesh.
  878|     12|      }
  879|       |
  880|  6.32k|      const CornerIndex corner_a = corner;
  881|  6.32k|      const VertexIndex vert_n =
  882|  6.32k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  6.32k|      const CornerIndex corner_b =
  884|  6.32k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  6.32k|      const VertexIndex vert_x =
  887|  6.32k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  6.32k|      const CornerIndex corner_c =
  889|  6.32k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  6.32k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 6, False: 6.32k]
  |  Branch (891:33): [True: 13, False: 6.31k]
  |  Branch (891:55): [True: 0, False: 6.31k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     19|        return -1;
  894|     19|      }
  895|  6.31k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 6.30k]
  |  Branch (895:11): [True: 1, False: 6.30k]
  ------------------
  896|  6.30k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 6.30k]
  ------------------
  897|  6.30k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 6.30k]
  ------------------
  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|  6.30k|      const VertexIndex vert_p =
  904|  6.30k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  6.30k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  6.30k|      const CornerIndex new_corner(3 * face.value());
  909|  6.30k|      SetOppositeCorners(new_corner, corner);
  910|  6.30k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  6.30k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  6.30k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  6.30k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  6.30k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  25.2k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 18.9k, False: 6.30k]
  ------------------
  920|  18.9k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  18.9k|      }
  922|       |
  923|  6.30k|      init_face_configurations_.push_back(true);
  924|  6.30k|      init_corners_.push_back(new_corner);
  925|  6.30k|    } 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.87k|      init_face_configurations_.push_back(false);
  930|  3.87k|      init_corners_.push_back(corner);
  931|  3.87k|    }
  932|  10.2k|  }
  933|  2.49k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 73, False: 2.41k]
  ------------------
  934|     73|    return -1;  // Unexpected number of decoded faces.
  935|     73|  }
  936|       |
  937|  2.41k|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  2.41k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 288, False: 2.40k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    288|    VertexIndex src_vert(num_vertices - 1);
  943|    328|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 40, False: 288]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     40|      src_vert = VertexIndex(--num_vertices - 1);
  946|     40|    }
  947|    288|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 40, False: 248]
  ------------------
  948|     40|      continue;  // No need to swap anything.
  949|     40|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    248|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  1.56k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 1.33k, False: 237]
  ------------------
  954|  1.33k|      const CornerIndex cid = vcit.Corner();
  955|  1.33k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 11, False: 1.32k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|     11|        return -1;
  959|     11|      }
  960|  1.32k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  1.32k|    }
  962|    237|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    237|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    237|    corner_table_->MakeVertexIsolated(src_vert);
  967|    237|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    237|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    237|    num_vertices--;
  972|    237|  }
  973|  2.40k|  return num_vertices;
  974|  2.41k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  3.15k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  3.15k|  uint32_t num_topology_splits;
  982|  3.15k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  3.15k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.15k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 120, False: 3.03k]
  ------------------
  984|    120|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 119]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    120|  } else
  989|  3.03k|#endif
  990|  3.03k|  {
  991|  3.03k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 26, False: 3.01k]
  ------------------
  992|     26|      return -1;
  993|     26|    }
  994|  3.03k|  }
  995|  3.13k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 818, False: 2.31k]
  ------------------
  996|    818|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 81, False: 737]
  ------------------
  997|    818|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     81|      return -1;
  999|     81|    }
 1000|    737|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    737|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    737|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 50, False: 687]
  ------------------
 1002|   110k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 110k, False: 15]
  ------------------
 1003|   110k|        TopologySplitEventData event_data;
 1004|   110k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 22, False: 110k]
  ------------------
 1005|     22|          return -1;
 1006|     22|        }
 1007|   110k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 12, False: 110k]
  ------------------
 1008|     12|          return -1;
 1009|     12|        }
 1010|   110k|        uint8_t edge_data;
 1011|   110k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 1, False: 110k]
  ------------------
 1012|      1|          return -1;
 1013|      1|        }
 1014|   110k|        event_data.source_edge = edge_data & 1;
 1015|   110k|        topology_split_data_.push_back(event_data);
 1016|   110k|      }
 1017|       |
 1018|     50|    } else
 1019|    687|#endif
 1020|    687|    {
 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|    687|      int last_source_symbol_id = 0;
 1024|  12.2k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 11.6k, False: 616]
  ------------------
 1025|  11.6k|        TopologySplitEventData event_data;
 1026|  11.6k|        uint32_t delta;
 1027|  11.6k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 28, False: 11.6k]
  ------------------
 1028|     28|          return -1;
 1029|     28|        }
 1030|  11.6k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  11.6k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 14, False: 11.5k]
  ------------------
 1032|     14|          return -1;
 1033|     14|        }
 1034|  11.5k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 29, False: 11.5k]
  ------------------
 1035|     29|          return -1;
 1036|     29|        }
 1037|  11.5k|        event_data.split_symbol_id =
 1038|  11.5k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  11.5k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  11.5k|        topology_split_data_.push_back(event_data);
 1041|  11.5k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    616|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  7.93k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 7.31k, False: 616]
  ------------------
 1045|  7.31k|        uint32_t edge_data;
 1046|  7.31k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  7.31k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 521, False: 6.79k]
  ------------------
 1047|    521|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  6.79k|        } else {
 1049|  6.79k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  6.79k|        }
 1051|  7.31k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  7.31k|        event_data.source_edge = edge_data & 1;
 1053|  7.31k|      }
 1054|    616|      decoder_buffer->EndBitDecoding();
 1055|    616|    }
 1056|    737|  }
 1057|  2.94k|  uint32_t num_hole_events = 0;
 1058|  2.94k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.94k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.94k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 62, False: 2.88k]
  ------------------
 1060|     62|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 59]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  2.88k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.88k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 72, False: 2.81k]
  ------------------
 1064|     72|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 13, False: 59]
  ------------------
 1065|     13|      return -1;
 1066|     13|    }
 1067|     72|  }
 1068|  2.92k|#endif
 1069|  2.92k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 73, False: 2.85k]
  ------------------
 1070|     73|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     73|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     73|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 37, False: 36]
  ------------------
 1072|   337k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 337k, False: 3]
  ------------------
 1073|   337k|        HoleEventData event_data;
 1074|   337k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 34, False: 337k]
  ------------------
 1075|     34|          return -1;
 1076|     34|        }
 1077|   337k|        hole_event_data_.push_back(event_data);
 1078|   337k|      }
 1079|       |
 1080|     37|    } else
 1081|     36|#endif
 1082|     36|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     36|      int last_symbol_id = 0;
 1085|    753|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 749, False: 4]
  ------------------
 1086|    749|        HoleEventData event_data;
 1087|    749|        uint32_t delta;
 1088|    749|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 32, False: 717]
  ------------------
 1089|     32|          return -1;
 1090|     32|        }
 1091|    717|        event_data.symbol_id = delta + last_symbol_id;
 1092|    717|        last_symbol_id = event_data.symbol_id;
 1093|    717|        hole_event_data_.push_back(event_data);
 1094|    717|      }
 1095|     36|    }
 1096|     73|  }
 1097|  2.86k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.92k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.71k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.71k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.71k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  6.84k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 5.13k, False: 1.71k]
  ------------------
 1109|  5.13k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  5.13k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 756, False: 4.38k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  1.51k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 756, False: 756]
  ------------------
 1114|    756|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|    756|      }
 1116|    756|      continue;
 1117|    756|    }
 1118|       |
 1119|  8.76k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 4.38k, False: 4.38k]
  ------------------
 1120|  4.38k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  4.38k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 4.28k, False: 99]
  ------------------
 1122|  4.28k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  4.28k|      }
 1124|  4.38k|    }
 1125|  4.38k|  }
 1126|  1.71k|  return true;
 1127|  1.71k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  15.6M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  15.6M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  15.6M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  15.6M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  62.5M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 46.9M, False: 15.6M]
  ------------------
 1139|  46.9M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  46.9M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 204k, False: 46.7M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   415k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 211k, False: 204k]
  ------------------
 1144|   211k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   211k|      }
 1146|   204k|      continue;
 1147|   204k|    }
 1148|  46.7M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  46.7M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 23.3M, False: 23.3M]
  ------------------
 1151|  23.3M|      continue;
 1152|  23.3M|    }
 1153|       |
 1154|  47.4M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 24.0M, False: 23.3M]
  ------------------
 1155|  24.0M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  24.0M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 21.9M, False: 2.07M]
  ------------------
 1157|  21.9M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  21.9M|      }
 1159|  24.0M|    }
 1160|  23.3M|  }
 1161|  15.6M|  return true;
 1162|  15.6M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  2.40k|    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|  2.40k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  2.40k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 35, False: 2.37k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  16.6k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 16.5k, False: 35]
  ------------------
 1176|  16.5k|      Mesh::Face face;
 1177|  16.5k|      const CornerIndex start_corner(3 * f.value());
 1178|  66.3k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 49.7k, False: 16.5k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  49.7k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  49.7k|        face[c] = vert_id;
 1182|  49.7k|      }
 1183|  16.5k|      decoder_->mesh()->SetFace(f, face);
 1184|  16.5k|    }
 1185|     35|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     35|    return true;
 1187|     35|  }
 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|  2.37k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  2.37k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  7.93M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 7.93M, False: 2.35k]
  ------------------
 1197|  7.93M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  7.93M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 4.22k, False: 7.92M]
  ------------------
 1199|  4.22k|      continue;  // Isolated vertex.
 1200|  4.22k|    }
 1201|  7.92M|    CornerIndex deduplication_first_corner = c;
 1202|  7.92M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 204k, False: 7.72M]
  ------------------
 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|   204k|      deduplication_first_corner = c;
 1206|  7.72M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  8.35M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 7.72M, False: 624k]
  ------------------
 1210|  7.72M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 608k, False: 7.11M]
  ------------------
 1211|   608k|          continue;  // No seam for this attribute, ignore it.
 1212|   608k|        }
 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|  7.11M|        const VertexIndex vert_id =
 1217|  7.11M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  7.11M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  7.11M|        bool seam_found = false;
 1220|  7.31M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 7.29M, False: 19.3k]
  ------------------
 1221|  7.29M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 16, False: 7.29M]
  ------------------
 1222|     16|            return false;
 1223|     16|          }
 1224|  7.29M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 7.09M, False: 193k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  7.09M|            deduplication_first_corner = act_c;
 1227|  7.09M|            seam_found = true;
 1228|  7.09M|            break;
 1229|  7.09M|          }
 1230|   193k|          act_c = corner_table_->SwingRight(act_c);
 1231|   193k|        }
 1232|  7.11M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 7.09M, False: 19.3k]
  ------------------
 1233|  7.09M|          break;  // No reason to process other attributes if we found a seam.
 1234|  7.09M|        }
 1235|  7.11M|      }
 1236|  7.72M|    }
 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|  7.92M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  7.92M|    corner_to_point_map[c.value()] =
 1246|  7.92M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  7.92M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  7.92M|    CornerIndex prev_c = c;
 1250|  7.92M|    c = corner_table_->SwingRight(c);
 1251|  46.8M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 46.6M, False: 206k]
  |  Branch (1251:40): [True: 38.9M, False: 7.71M]
  ------------------
 1252|  38.9M|      bool attribute_seam = false;
 1253|  42.2M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 38.9M, False: 3.27M]
  ------------------
 1254|  38.9M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 35.6M, False: 3.29M]
  ------------------
 1255|  38.9M|            attribute_data_[i].connectivity_data.Vertex(prev_c)) {
 1256|       |          // Attribute index changed from the previous corner. We need to add a
 1257|       |          // new point here.
 1258|  35.6M|          attribute_seam = true;
 1259|  35.6M|          break;
 1260|  35.6M|        }
 1261|  38.9M|      }
 1262|  38.9M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 35.6M, False: 3.27M]
  ------------------
 1263|  35.6M|        corner_to_point_map[c.value()] =
 1264|  35.6M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  35.6M|        point_to_corner_map.push_back(c.value());
 1266|  35.6M|      } else {
 1267|  3.27M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  3.27M|      }
 1269|  38.9M|      prev_c = c;
 1270|  38.9M|      c = corner_table_->SwingRight(c);
 1271|  38.9M|    }
 1272|  7.92M|  }
 1273|       |  // Add faces.
 1274|  15.5M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 15.5M, False: 2.35k]
  ------------------
 1275|  15.5M|    Mesh::Face face;
 1276|  62.3M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 46.7M, False: 15.5M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  46.7M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  46.7M|    }
 1280|  15.5M|    decoder_->mesh()->SetFace(f, face);
 1281|  15.5M|  }
 1282|  2.35k|  decoder_->point_cloud()->set_num_points(
 1283|  2.35k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  2.35k|  return true;
 1285|  2.37k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  3.36k|    : decoder_(nullptr),
   49|  3.36k|      last_symbol_id_(-1),
   50|  3.36k|      last_vert_id_(-1),
   51|  3.36k|      last_face_id_(-1),
   52|  3.36k|      num_new_vertices_(0),
   53|  3.36k|      num_encoded_vertices_(0),
   54|  3.36k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  3.36k|    MeshEdgebreakerDecoder* decoder) {
   59|  3.36k|  decoder_ = decoder;
   60|  3.36k|  return true;
   61|  3.36k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    292|    int att_id) const {
   67|    499|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 351, False: 148]
  ------------------
   68|    351|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    351|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 207, False: 144]
  |  Branch (69:27): [True: 0, False: 144]
  ------------------
   70|    207|      continue;
   71|    207|    }
   72|    144|    const AttributesDecoderInterface* const dec =
   73|    144|        decoder_->attributes_decoder(decoder_id);
   74|  1.29k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 1.29k, False: 0]
  ------------------
   75|  1.29k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 144, False: 1.15k]
  ------------------
   76|    144|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 117, False: 27]
  ------------------
   77|    117|          return &attribute_data_[i].connectivity_data;
   78|    117|        }
   79|     27|        return nullptr;
   80|    144|      }
   81|  1.29k|    }
   82|    144|  }
   83|    148|  return nullptr;
   84|    292|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    292|    int att_id) const {
   90|    499|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 351, False: 148]
  ------------------
   91|    351|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    351|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 207, False: 144]
  |  Branch (92:27): [True: 0, False: 144]
  ------------------
   93|    207|      continue;
   94|    207|    }
   95|    144|    const AttributesDecoderInterface* const dec =
   96|    144|        decoder_->attributes_decoder(decoder_id);
   97|  1.29k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 1.29k, False: 0]
  ------------------
   98|  1.29k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 144, False: 1.15k]
  ------------------
   99|    144|        return &attribute_data_[i].encoding_data;
  100|    144|      }
  101|  1.29k|    }
  102|    144|  }
  103|    148|  return &pos_encoding_data_;
  104|    292|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    241|    int32_t att_decoder_id) {
  131|    241|  int8_t att_data_id;
  132|    241|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 11, False: 230]
  ------------------
  133|     11|    return false;
  134|     11|  }
  135|    230|  uint8_t decoder_type;
  136|    230|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 13, False: 217]
  ------------------
  137|     13|    return false;
  138|     13|  }
  139|       |
  140|    217|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 132, False: 85]
  ------------------
  141|    132|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 21, False: 111]
  ------------------
  142|     21|      return false;  // Unexpected attribute data.
  143|     21|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|    111|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 5, False: 106]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|       |
  151|    106|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    106|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|     85|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 3, False: 82]
  ------------------
  155|      3|      return false;  // Some other decoder is already using the data. Error.
  156|      3|    }
  157|     82|    pos_data_decoder_id_ = att_decoder_id;
  158|     82|  }
  159|       |
  160|    188|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    188|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    188|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 188, False: 0]
  ------------------
  162|    188|    uint8_t traversal_method_encoded;
  163|    188|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 5, False: 183]
  ------------------
  164|      5|      return false;
  165|      5|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    183|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 21, False: 162]
  ------------------
  168|     21|      return false;
  169|     21|    }
  170|    162|    traversal_method =
  171|    162|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    162|  }
  173|       |
  174|    162|  const Mesh* mesh = decoder_->mesh();
  175|    162|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    162|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 71, False: 91]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|     71|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|     71|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 52, False: 19]
  ------------------
  182|     52|      encoding_data = &pos_encoding_data_;
  183|     52|    } else {
  184|     19|      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|     19|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     19|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|     71|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 33, False: 38]
  ------------------
  191|     33|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     33|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     33|          AttTraverser;
  194|     33|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|     38|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 38, False: 0]
  ------------------
  196|     38|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|     38|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|     38|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|     38|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|     91|  } else {
  203|     91|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 4, False: 87]
  ------------------
  204|      4|      return false;  // Unsupported method.
  205|      4|    }
  206|     87|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 9, False: 78]
  ------------------
  207|      9|      return false;  // Attribute data must be specified.
  208|      9|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     78|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     78|        AttObserver;
  214|     78|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     78|        AttTraverser;
  216|       |
  217|     78|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|     78|        &attribute_data_[att_data_id].encoding_data;
  219|     78|    const MeshAttributeCornerTable* const corner_table =
  220|     78|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     78|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     78|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     78|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     78|                             encoding_data);
  227|       |
  228|     78|    AttTraverser att_traverser;
  229|     78|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     78|    traversal_sequencer->SetTraverser(att_traverser);
  232|     78|    sequencer = std::move(traversal_sequencer);
  233|     78|  }
  234|       |
  235|    149|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 149]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|    149|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|    149|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|    149|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|    149|                                        std::move(att_controller));
  244|    149|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  3.36k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  3.36k|  num_new_vertices_ = 0;
  249|  3.36k|  new_to_parent_vertex_map_.clear();
  250|  3.36k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  3.36k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.36k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 654, False: 2.70k]
  ------------------
  252|    654|    uint32_t num_new_verts;
  253|    654|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    654|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 347, False: 307]
  ------------------
  254|    347|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 9, False: 338]
  ------------------
  255|      9|        return false;
  256|      9|      }
  257|    347|    } else {
  258|    307|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 3, False: 304]
  ------------------
  259|      3|        return false;
  260|      3|      }
  261|    307|    }
  262|    642|    num_new_vertices_ = num_new_verts;
  263|    642|  }
  264|  3.34k|#endif
  265|       |
  266|  3.34k|  uint32_t num_encoded_vertices;
  267|  3.34k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  3.34k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.34k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 338, False: 3.01k]
  ------------------
  269|    338|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 5, False: 333]
  ------------------
  270|      5|      return false;
  271|      5|    }
  272|       |
  273|    338|  } else
  274|  3.01k|#endif
  275|  3.01k|  {
  276|  3.01k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 6, False: 3.00k]
  ------------------
  277|      6|      return false;
  278|      6|    }
  279|  3.01k|  }
  280|  3.33k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  3.33k|  uint32_t num_faces;
  283|  3.33k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  3.33k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.33k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 333, False: 3.00k]
  ------------------
  285|    333|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 4, False: 329]
  ------------------
  286|      4|      return false;
  287|      4|    }
  288|       |
  289|    333|  } else
  290|  3.00k|#endif
  291|  3.00k|  {
  292|  3.00k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 4, False: 3.00k]
  ------------------
  293|      4|      return false;
  294|      4|    }
  295|  3.00k|  }
  296|  3.33k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 3, False: 3.32k]
  ------------------
  297|      3|    return false;  // Draco cannot handle this many faces.
  298|      3|  }
  299|       |
  300|  3.32k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 32, False: 3.29k]
  ------------------
  301|     32|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     32|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  3.29k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  3.29k|  const uint64_t num_encoded_vertices_64 =
  311|  3.29k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  3.29k|  const uint64_t max_num_vertex_edges =
  313|  3.29k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  3.29k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 19, False: 3.27k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     19|    return false;
  317|     19|  }
  318|       |
  319|  3.27k|  uint8_t num_attribute_data;
  320|  3.27k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 45, False: 3.23k]
  ------------------
  321|     45|    return false;
  322|     45|  }
  323|       |
  324|  3.23k|  uint32_t num_encoded_symbols;
  325|  3.23k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  3.23k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.23k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 305, False: 2.92k]
  ------------------
  327|    305|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 9, False: 296]
  ------------------
  328|      9|      return false;
  329|      9|    }
  330|       |
  331|    305|  } else
  332|  2.92k|#endif
  333|  2.92k|  {
  334|  2.92k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 7, False: 2.91k]
  ------------------
  335|      7|      return false;
  336|      7|    }
  337|  2.92k|  }
  338|       |
  339|  3.21k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 24, False: 3.19k]
  ------------------
  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|     24|    return false;
  344|     24|  }
  345|  3.19k|  const uint32_t max_encoded_faces =
  346|  3.19k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  3.19k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 59, False: 3.13k]
  ------------------
  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|     59|    return false;
  352|     59|  }
  353|       |
  354|  3.13k|  uint32_t num_encoded_split_symbols;
  355|  3.13k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  3.13k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.13k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 276, False: 2.85k]
  ------------------
  357|    276|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 3, False: 273]
  ------------------
  358|      3|      return false;
  359|      3|    }
  360|       |
  361|    276|  } else
  362|  2.85k|#endif
  363|  2.85k|  {
  364|  2.85k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 5, False: 2.85k]
  ------------------
  365|      5|      return false;
  366|      5|    }
  367|  2.85k|  }
  368|       |
  369|  3.12k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 48, False: 3.07k]
  ------------------
  370|     48|    return false;  // Split symbols are a sub-set of all symbols.
  371|     48|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  3.07k|  vertex_traversal_length_.clear();
  375|  3.07k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  3.07k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 3.07k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  3.07k|  processed_corner_ids_.clear();
  380|  3.07k|  processed_corner_ids_.reserve(num_faces);
  381|  3.07k|  processed_connectivity_corners_.clear();
  382|  3.07k|  processed_connectivity_corners_.reserve(num_faces);
  383|  3.07k|  topology_split_data_.clear();
  384|  3.07k|  hole_event_data_.clear();
  385|  3.07k|  init_face_configurations_.clear();
  386|  3.07k|  init_corners_.clear();
  387|       |
  388|  3.07k|  last_symbol_id_ = -1;
  389|  3.07k|  last_face_id_ = -1;
  390|  3.07k|  last_vert_id_ = -1;
  391|       |
  392|  3.07k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  3.07k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  3.07k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 3.07k]
  ------------------
  397|  3.07k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      1|    return false;
  399|      1|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  3.07k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  3.07k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  3.07k|  int32_t topology_split_decoded_bytes = -1;
  410|  3.07k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.07k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 550, False: 2.52k]
  ------------------
  411|    550|    uint32_t encoded_connectivity_size;
  412|    550|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    550|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 265, False: 285]
  ------------------
  413|    265|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 3, False: 262]
  ------------------
  414|      3|        return false;
  415|      3|      }
  416|    285|    } else {
  417|    285|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 4, False: 281]
  ------------------
  418|      4|        return false;
  419|      4|      }
  420|    285|    }
  421|    543|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 2, False: 541]
  ------------------
  422|    541|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 35, False: 506]
  ------------------
  423|     37|      return false;
  424|     37|    }
  425|    506|    DecoderBuffer event_buffer;
  426|    506|    event_buffer.Init(
  427|    506|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    506|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    506|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    506|    topology_split_decoded_bytes =
  432|    506|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    506|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 171, False: 335]
  ------------------
  434|    171|      return false;
  435|    171|    }
  436|       |
  437|    506|  } else
  438|  2.52k|#endif
  439|  2.52k|  {
  440|  2.52k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 104, False: 2.42k]
  ------------------
  441|    104|      return false;
  442|    104|    }
  443|  2.52k|  }
  444|       |
  445|  2.75k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.75k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.75k|                                           num_encoded_split_symbols);
  449|  2.75k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.75k|  DecoderBuffer traversal_end_buffer;
  452|  2.75k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 1.55k, False: 1.20k]
  ------------------
  453|  1.55k|    return false;
  454|  1.55k|  }
  455|       |
  456|  1.20k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.20k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 933, False: 271]
  ------------------
  458|    933|    return false;
  459|    933|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    271|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    271|                           traversal_end_buffer.remaining_size(),
  464|    271|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    271|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    271|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    271|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 5, False: 266]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      5|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      5|  }
  471|    271|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    271|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 231, False: 40]
  ------------------
  475|    231|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    231|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    231|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 5, False: 226]
  ------------------
  477|     15|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 10, False: 5]
  ------------------
  478|     10|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 10]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|     10|      }
  482|       |
  483|      5|    } else
  484|    226|#endif
  485|    226|    {
  486|   295k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 295k, False: 226]
  ------------------
  487|   295k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 295k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   295k|      }
  491|    226|    }
  492|    231|  }
  493|    271|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    737|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 466, False: 271]
  ------------------
  498|    466|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   346k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 346k, False: 466]
  ------------------
  501|   346k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   346k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    466|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 466]
  ------------------
  505|    466|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    466|  }
  509|       |
  510|    271|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    737|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 466, False: 271]
  ------------------
  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|    466|    int32_t att_connectivity_verts =
  517|    466|        attribute_data_[i].connectivity_data.num_vertices();
  518|    466|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 6, False: 460]
  ------------------
  519|      6|      att_connectivity_verts = corner_table_->num_vertices();
  520|      6|    }
  521|    466|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    466|  }
  523|    271|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 19, False: 252]
  ------------------
  524|     19|    return false;
  525|     19|  }
  526|    252|  return true;
  527|    271|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     36|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     36|  return true;
  532|     36|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|  1.20k|    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.20k|  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.20k|  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.20k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.20k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.20k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.20k|  int num_faces = 0;
  562|  76.0M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 76.0M, False: 411]
  ------------------
  563|  76.0M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  76.0M|    bool check_topology_split = false;
  566|  76.0M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  76.0M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 4.77M, False: 71.3M]
  ------------------
  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.77M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 60, False: 4.77M]
  ------------------
  588|     60|        return -1;
  589|     60|      }
  590|       |
  591|  4.77M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  4.77M|      const VertexIndex vertex_x =
  593|  4.77M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  4.77M|      const CornerIndex corner_b =
  595|  4.77M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  4.77M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 336, False: 4.77M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    336|        return -1;
  600|    336|      }
  601|  4.77M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 4.77M]
  |  Branch (601:11): [True: 0, False: 4.77M]
  ------------------
  602|  4.77M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 4.77M]
  ------------------
  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.77M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  4.77M|      SetOppositeCorners(corner_a, corner + 1);
  612|  4.77M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  4.77M|      const VertexIndex vert_a_prev =
  616|  4.77M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  4.77M|      const VertexIndex vert_b_next =
  618|  4.77M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  4.77M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 4.77M]
  |  Branch (619:38): [True: 0, False: 4.77M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  4.77M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  4.77M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  4.77M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  4.77M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  4.77M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  4.77M|      active_corner_stack.back() = corner;
  631|  71.3M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 15.1k, False: 71.3M]
  |  Branch (631:40): [True: 64.4M, False: 6.87M]
  ------------------
  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|  64.4M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 64.4M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  64.4M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  64.4M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 64.4M]
  ------------------
  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|  64.4M|      const CornerIndex corner(3 * face.value());
  658|  64.4M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  64.4M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 15.1k, False: 64.4M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  15.1k|        opp_corner = corner + 2;
  662|  15.1k|        corner_l = corner + 1;
  663|  15.1k|        corner_r = corner;
  664|  64.4M|      } else {
  665|       |        // "l" is the new first corner.
  666|  64.4M|        opp_corner = corner + 1;
  667|  64.4M|        corner_l = corner;
  668|  64.4M|        corner_r = corner + 2;
  669|  64.4M|      }
  670|  64.4M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  64.4M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  64.4M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 10, False: 64.4M]
  ------------------
  675|     10|        return -1;  // Unexpected number of decoded vertices.
  676|     10|      }
  677|       |
  678|  64.4M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  64.4M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  64.4M|      const VertexIndex vertex_r =
  682|  64.4M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  64.4M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  64.4M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  64.4M|      corner_table_->MapCornerToVertex(
  688|  64.4M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  64.4M|      active_corner_stack.back() = corner;
  690|  64.4M|      check_topology_split = true;
  691|  64.4M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 37.6k, False: 6.83M]
  ------------------
  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|  37.6k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 2, False: 37.6k]
  ------------------
  703|      2|        return -1;
  704|      2|      }
  705|  37.6k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  37.6k|      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|  37.6k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  37.6k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 38, False: 37.6k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     38|        active_corner_stack.push_back(it->second);
  714|     38|      }
  715|  37.6k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 80, False: 37.6k]
  ------------------
  716|     80|        return -1;
  717|     80|      }
  718|  37.6k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  37.6k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 37.6k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  37.6k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 3, False: 37.6k]
  |  Branch (724:11): [True: 3, False: 37.6k]
  ------------------
  725|  37.6k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 37.6k]
  ------------------
  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|  37.6k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  37.6k|      SetOppositeCorners(corner_a, corner + 2);
  735|  37.6k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  37.6k|      const VertexIndex vertex_p =
  739|  37.6k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  37.6k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  37.6k|      corner_table_->MapCornerToVertex(
  742|  37.6k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  37.6k|      const VertexIndex vert_b_prev =
  744|  37.6k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  37.6k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  37.6k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  37.6k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  37.6k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  37.6k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  37.6k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  37.6k|                                       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|  37.6k|      const CornerIndex first_corner = corner_n;
  757|  10.3M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 10.2M, False: 37.6k]
  ------------------
  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|  37.6k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  37.6k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 37.4k, False: 177]
  ------------------
  770|  37.4k|        invalid_vertices.push_back(vertex_n);
  771|  37.4k|      }
  772|  37.6k|      active_corner_stack.back() = corner;
  773|  6.83M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 6.83M, False: 250]
  ------------------
  774|  6.83M|      const CornerIndex corner(3 * face.value());
  775|  6.83M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  6.83M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  6.83M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  6.83M|                                       corner_table_->AddNewVertex());
  780|  6.83M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  6.83M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  6.83M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 13, False: 6.83M]
  ------------------
  784|     13|        return -1;  // Unexpected number of decoded vertices.
  785|     13|      }
  786|       |
  787|  6.83M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  6.83M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  6.83M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  6.83M|      active_corner_stack.push_back(corner);
  792|  6.83M|      check_topology_split = true;
  793|  6.83M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    250|      return -1;
  796|    250|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  76.0M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  76.0M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 71.2M, False: 4.81M]
  ------------------
  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|  71.2M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  71.2M|      EdgeFaceName split_edge;
  812|  71.2M|      int encoder_split_symbol_id;
  813|  71.2M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.29k, False: 71.2M]
  ------------------
  814|  71.2M|                             &encoder_split_symbol_id)) {
  815|  1.29k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 37, False: 1.25k]
  ------------------
  816|     37|          return -1;  // Wrong split symbol id.
  817|     37|        }
  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.25k|        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.25k|        CornerIndex new_active_corner;
  831|  1.25k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 461, False: 796]
  ------------------
  832|    461|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    796|        } else {
  834|    796|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    796|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.25k|        const int decoder_split_symbol_id =
  839|  1.25k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.25k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.25k|            new_active_corner;
  842|  1.25k|      }
  843|  71.2M|    }
  844|  76.0M|  }
  845|    411|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 411]
  ------------------
  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|  6.07M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 6.07M, False: 368]
  ------------------
  850|  6.07M|    const CornerIndex corner = active_corner_stack.back();
  851|  6.07M|    active_corner_stack.pop_back();
  852|  6.07M|    const bool interior_face =
  853|  6.07M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  6.07M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 2.74M, False: 3.32M]
  ------------------
  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.74M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 39, False: 2.74M]
  ------------------
  877|     39|        return -1;  // More faces than expected added to the mesh.
  878|     39|      }
  879|       |
  880|  2.74M|      const CornerIndex corner_a = corner;
  881|  2.74M|      const VertexIndex vert_n =
  882|  2.74M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  2.74M|      const CornerIndex corner_b =
  884|  2.74M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  2.74M|      const VertexIndex vert_x =
  887|  2.74M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  2.74M|      const CornerIndex corner_c =
  889|  2.74M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  2.74M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 2.74M]
  |  Branch (891:33): [True: 2, False: 2.74M]
  |  Branch (891:55): [True: 0, False: 2.74M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      4|        return -1;
  894|      4|      }
  895|  2.74M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 2.74M]
  |  Branch (895:11): [True: 0, False: 2.74M]
  ------------------
  896|  2.74M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 2.74M]
  ------------------
  897|  2.74M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 2.74M]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      0|        return -1;
  901|      0|      }
  902|       |
  903|  2.74M|      const VertexIndex vert_p =
  904|  2.74M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  2.74M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  2.74M|      const CornerIndex new_corner(3 * face.value());
  909|  2.74M|      SetOppositeCorners(new_corner, corner);
  910|  2.74M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  2.74M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  2.74M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  2.74M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  2.74M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  10.9M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 8.24M, False: 2.74M]
  ------------------
  920|  8.24M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  8.24M|      }
  922|       |
  923|  2.74M|      init_face_configurations_.push_back(true);
  924|  2.74M|      init_corners_.push_back(new_corner);
  925|  3.32M|    } 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.32M|      init_face_configurations_.push_back(false);
  930|  3.32M|      init_corners_.push_back(corner);
  931|  3.32M|    }
  932|  6.07M|  }
  933|    368|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 92, False: 276]
  ------------------
  934|     92|    return -1;  // Unexpected number of decoded faces.
  935|     92|  }
  936|       |
  937|    276|  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|  4.15k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 4.15k, False: 271]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  4.15k|    VertexIndex src_vert(num_vertices - 1);
  943|  5.10k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 949, False: 4.15k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    949|      src_vert = VertexIndex(--num_vertices - 1);
  946|    949|    }
  947|  4.15k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 630, False: 3.52k]
  ------------------
  948|    630|      continue;  // No need to swap anything.
  949|    630|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  3.52k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  14.2k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 10.7k, False: 3.51k]
  ------------------
  954|  10.7k|      const CornerIndex cid = vcit.Corner();
  955|  10.7k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 5, False: 10.7k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      5|        return -1;
  959|      5|      }
  960|  10.7k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  10.7k|    }
  962|  3.51k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  3.51k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  3.51k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  3.51k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  3.51k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  3.51k|    num_vertices--;
  972|  3.51k|  }
  973|    271|  return num_vertices;
  974|    276|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  3.03k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  3.03k|  uint32_t num_topology_splits;
  982|  3.03k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  3.03k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.03k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 246, False: 2.78k]
  ------------------
  984|    246|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 3, False: 243]
  ------------------
  985|      3|      return -1;
  986|      3|    }
  987|       |
  988|    246|  } else
  989|  2.78k|#endif
  990|  2.78k|  {
  991|  2.78k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 21, False: 2.76k]
  ------------------
  992|     21|      return -1;
  993|     21|    }
  994|  2.78k|  }
  995|  3.00k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 544, False: 2.46k]
  ------------------
  996|    544|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 75, False: 469]
  ------------------
  997|    544|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     75|      return -1;
  999|     75|    }
 1000|    469|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    469|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    469|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 75, False: 394]
  ------------------
 1002|   125k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 125k, False: 30]
  ------------------
 1003|   125k|        TopologySplitEventData event_data;
 1004|   125k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 27, False: 125k]
  ------------------
 1005|     27|          return -1;
 1006|     27|        }
 1007|   125k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 15, False: 125k]
  ------------------
 1008|     15|          return -1;
 1009|     15|        }
 1010|   125k|        uint8_t edge_data;
 1011|   125k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 125k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|   125k|        event_data.source_edge = edge_data & 1;
 1015|   125k|        topology_split_data_.push_back(event_data);
 1016|   125k|      }
 1017|       |
 1018|     75|    } else
 1019|    394|#endif
 1020|    394|    {
 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|    394|      int last_source_symbol_id = 0;
 1024|  87.2k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 86.9k, False: 355]
  ------------------
 1025|  86.9k|        TopologySplitEventData event_data;
 1026|  86.9k|        uint32_t delta;
 1027|  86.9k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 20, False: 86.9k]
  ------------------
 1028|     20|          return -1;
 1029|     20|        }
 1030|  86.9k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  86.9k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 8, False: 86.9k]
  ------------------
 1032|      8|          return -1;
 1033|      8|        }
 1034|  86.9k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 11, False: 86.9k]
  ------------------
 1035|     11|          return -1;
 1036|     11|        }
 1037|  86.9k|        event_data.split_symbol_id =
 1038|  86.9k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  86.9k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  86.9k|        topology_split_data_.push_back(event_data);
 1041|  86.9k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    355|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  5.37k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 5.02k, False: 355]
  ------------------
 1045|  5.02k|        uint32_t edge_data;
 1046|  5.02k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.02k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 583, False: 4.43k]
  ------------------
 1047|    583|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  4.43k|        } else {
 1049|  4.43k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  4.43k|        }
 1051|  5.02k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  5.02k|        event_data.source_edge = edge_data & 1;
 1053|  5.02k|      }
 1054|    355|      decoder_buffer->EndBitDecoding();
 1055|    355|    }
 1056|    469|  }
 1057|  2.84k|  uint32_t num_hole_events = 0;
 1058|  2.84k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.84k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.84k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 172, False: 2.67k]
  ------------------
 1060|    172|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 4, False: 168]
  ------------------
 1061|      4|      return -1;
 1062|      4|    }
 1063|  2.67k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.67k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 249, False: 2.42k]
  ------------------
 1064|    249|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 13, False: 236]
  ------------------
 1065|     13|      return -1;
 1066|     13|    }
 1067|    249|  }
 1068|  2.83k|#endif
 1069|  2.83k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 101, False: 2.73k]
  ------------------
 1070|    101|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|    101|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    101|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 57, False: 44]
  ------------------
 1072|   126k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 126k, False: 9]
  ------------------
 1073|   126k|        HoleEventData event_data;
 1074|   126k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 48, False: 126k]
  ------------------
 1075|     48|          return -1;
 1076|     48|        }
 1077|   126k|        hole_event_data_.push_back(event_data);
 1078|   126k|      }
 1079|       |
 1080|     57|    } else
 1081|     44|#endif
 1082|     44|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     44|      int last_symbol_id = 0;
 1085|  98.6k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 98.6k, False: 17]
  ------------------
 1086|  98.6k|        HoleEventData event_data;
 1087|  98.6k|        uint32_t delta;
 1088|  98.6k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 27, False: 98.6k]
  ------------------
 1089|     27|          return -1;
 1090|     27|        }
 1091|  98.6k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  98.6k|        last_symbol_id = event_data.symbol_id;
 1093|  98.6k|        hole_event_data_.push_back(event_data);
 1094|  98.6k|      }
 1095|     44|    }
 1096|    101|  }
 1097|  2.75k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.83k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|     10|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|     10|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|     10|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     40|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 30, False: 10]
  ------------------
 1109|     30|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     30|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 10, False: 20]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     20|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 10, False: 10]
  ------------------
 1114|     10|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|     10|      }
 1116|     10|      continue;
 1117|     10|    }
 1118|       |
 1119|     40|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 20, False: 20]
  ------------------
 1120|     20|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     20|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 10, False: 10]
  ------------------
 1122|     10|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|     10|      }
 1124|     20|    }
 1125|     20|  }
 1126|     10|  return true;
 1127|     10|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   295k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   295k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   295k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   295k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.18M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 887k, False: 295k]
  ------------------
 1139|   887k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   887k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 172k, False: 714k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   346k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 173k, False: 172k]
  ------------------
 1144|   173k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   173k|      }
 1146|   172k|      continue;
 1147|   172k|    }
 1148|   714k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   714k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 357k, False: 357k]
  ------------------
 1151|   357k|      continue;
 1152|   357k|    }
 1153|       |
 1154|   714k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 357k, False: 357k]
  ------------------
 1155|   357k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   357k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 172k, False: 184k]
  ------------------
 1157|   172k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   172k|      }
 1159|   357k|    }
 1160|   357k|  }
 1161|   295k|  return true;
 1162|   295k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    271|    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|    271|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    271|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 40, False: 231]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|   134k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 134k, False: 40]
  ------------------
 1176|   134k|      Mesh::Face face;
 1177|   134k|      const CornerIndex start_corner(3 * f.value());
 1178|   539k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 404k, False: 134k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   404k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   404k|        face[c] = vert_id;
 1182|   404k|      }
 1183|   134k|      decoder_->mesh()->SetFace(f, face);
 1184|   134k|    }
 1185|     40|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     40|    return true;
 1187|     40|  }
 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|    231|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    231|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   236k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 236k, False: 212]
  ------------------
 1197|   236k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   236k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 92, False: 236k]
  ------------------
 1199|     92|      continue;  // Isolated vertex.
 1200|     92|    }
 1201|   236k|    CornerIndex deduplication_first_corner = c;
 1202|   236k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 171k, False: 65.1k]
  ------------------
 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|   171k|      deduplication_first_corner = c;
 1206|   171k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  72.6k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 65.1k, False: 7.45k]
  ------------------
 1210|  65.1k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 7.23k, False: 57.9k]
  ------------------
 1211|  7.23k|          continue;  // No seam for this attribute, ignore it.
 1212|  7.23k|        }
 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|  57.9k|        const VertexIndex vert_id =
 1217|  57.9k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  57.9k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  57.9k|        bool seam_found = false;
 1220|  72.5k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 72.2k, False: 308]
  ------------------
 1221|  72.2k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 19, False: 72.2k]
  ------------------
 1222|     19|            return false;
 1223|     19|          }
 1224|  72.2k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 57.6k, False: 14.6k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  57.6k|            deduplication_first_corner = act_c;
 1227|  57.6k|            seam_found = true;
 1228|  57.6k|            break;
 1229|  57.6k|          }
 1230|  14.6k|          act_c = corner_table_->SwingRight(act_c);
 1231|  14.6k|        }
 1232|  57.9k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 57.6k, False: 308]
  ------------------
 1233|  57.6k|          break;  // No reason to process other attributes if we found a seam.
 1234|  57.6k|        }
 1235|  57.9k|      }
 1236|  65.1k|    }
 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|   803k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 632k, False: 171k]
  |  Branch (1251:40): [True: 567k, False: 64.6k]
  ------------------
 1252|   567k|      bool attribute_seam = false;
 1253|  1.01M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 567k, False: 445k]
  ------------------
 1254|   567k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 122k, False: 445k]
  ------------------
 1255|   567k|            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|   122k|          attribute_seam = true;
 1259|   122k|          break;
 1260|   122k|        }
 1261|   567k|      }
 1262|   567k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 122k, False: 445k]
  ------------------
 1263|   122k|        corner_to_point_map[c.value()] =
 1264|   122k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   122k|        point_to_corner_map.push_back(c.value());
 1266|   445k|      } else {
 1267|   445k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   445k|      }
 1269|   567k|      prev_c = c;
 1270|   567k|      c = corner_table_->SwingRight(c);
 1271|   567k|    }
 1272|   236k|  }
 1273|       |  // Add faces.
 1274|  94.7k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 94.5k, False: 212]
  ------------------
 1275|  94.5k|    Mesh::Face face;
 1276|   378k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 283k, False: 94.5k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   283k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   283k|    }
 1280|  94.5k|    decoder_->mesh()->SetFace(f, face);
 1281|  94.5k|  }
 1282|    212|  decoder_->point_cloud()->set_num_points(
 1283|    212|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    212|  return true;
 1285|    231|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    319|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    319|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    319|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    319|  const Mesh* mesh = decoder_->mesh();
  115|    319|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    319|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    319|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    319|                           encoding_data);
  120|       |
  121|    319|  TraverserT att_traverser;
  122|    319|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    319|  traversal_sequencer->SetTraverser(att_traverser);
  125|    319|  return std::move(traversal_sequencer);
  126|    319|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|  1.36k|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|  1.36k|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|  1.36k|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|  1.36k|  const Mesh* mesh = decoder_->mesh();
  115|  1.36k|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|  1.36k|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|  1.36k|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|  1.36k|                           encoding_data);
  120|       |
  121|  1.36k|  TraverserT att_traverser;
  122|  1.36k|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|  1.36k|  traversal_sequencer->SetTraverser(att_traverser);
  125|  1.36k|  return std::move(traversal_sequencer);
  126|  1.36k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    361|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    361|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    361|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    361|  const Mesh* mesh = decoder_->mesh();
  115|    361|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    361|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    361|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    361|                           encoding_data);
  120|       |
  121|    361|  TraverserT att_traverser;
  122|    361|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    361|  traversal_sequencer->SetTraverser(att_traverser);
  125|    361|  return std::move(traversal_sequencer);
  126|    361|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    745|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    745|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    745|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    745|  const Mesh* mesh = decoder_->mesh();
  115|    745|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    745|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    745|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    745|                           encoding_data);
  120|       |
  121|    745|  TraverserT att_traverser;
  122|    745|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    745|  traversal_sequencer->SetTraverser(att_traverser);
  125|    745|  return std::move(traversal_sequencer);
  126|    745|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     33|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|     33|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     33|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     33|  const Mesh* mesh = decoder_->mesh();
  115|     33|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     33|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     33|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     33|                           encoding_data);
  120|       |
  121|     33|  TraverserT att_traverser;
  122|     33|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     33|  traversal_sequencer->SetTraverser(att_traverser);
  125|     33|  return std::move(traversal_sequencer);
  126|     33|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     38|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|     38|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     38|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     38|  const Mesh* mesh = decoder_->mesh();
  115|     38|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     38|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     38|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     38|                           encoding_data);
  120|       |
  121|     38|  TraverserT att_traverser;
  122|     38|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     38|  traversal_sequencer->SetTraverser(att_traverser);
  125|     38|  return std::move(traversal_sequencer);
  126|     38|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  12.4k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  4.48k|  const CornerTable* GetCornerTable() const override {
   67|  4.48k|    return corner_table_.get();
   68|  4.48k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  5.58M|                       int* out_encoder_split_symbol_id) {
   87|  5.58M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 39.6k, False: 5.54M]
  ------------------
   88|  39.6k|      return false;
   89|  39.6k|    }
   90|  5.54M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 45, False: 5.54M]
  ------------------
   91|  5.54M|        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|     45|      *out_encoder_split_symbol_id = -1;
   98|     45|      return true;
   99|     45|    }
  100|  5.54M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 5.54M, False: 2.40k]
  ------------------
  101|  5.54M|      return false;
  102|  5.54M|    }
  103|  2.40k|    *out_face_edge =
  104|  2.40k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  2.40k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  2.40k|    topology_split_data_.pop_back();
  108|  2.40k|    return true;
  109|  5.54M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  15.9M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  15.9M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  15.9M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  15.9M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  24.8k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  8.58k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  5.42k|  const CornerTable* GetCornerTable() const override {
   67|  5.42k|    return corner_table_.get();
   68|  5.42k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  35.5M|                       int* out_encoder_split_symbol_id) {
   87|  35.5M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 35.4M, False: 93.0k]
  ------------------
   88|  35.4M|      return false;
   89|  35.4M|    }
   90|  93.0k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 18, False: 93.0k]
  ------------------
   91|  93.0k|        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|     18|      *out_encoder_split_symbol_id = -1;
   98|     18|      return true;
   99|     18|    }
  100|  93.0k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 91.6k, False: 1.43k]
  ------------------
  101|  91.6k|      return false;
  102|  91.6k|    }
  103|  1.43k|    *out_face_edge =
  104|  1.43k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.43k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.43k|    topology_split_data_.pop_back();
  108|  1.43k|    return true;
  109|  93.0k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|   105M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|   105M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|   105M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|   105M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  13.4k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  14.7k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  3.04k|  const CornerTable* GetCornerTable() const override {
   67|  3.04k|    return corner_table_.get();
   68|  3.04k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  71.2M|                       int* out_encoder_split_symbol_id) {
   87|  71.2M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 70.6M, False: 590k]
  ------------------
   88|  70.6M|      return false;
   89|  70.6M|    }
   90|   590k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 37, False: 590k]
  ------------------
   91|   590k|        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|     37|      *out_encoder_split_symbol_id = -1;
   98|     37|      return true;
   99|     37|    }
  100|   590k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 589k, False: 1.25k]
  ------------------
  101|   589k|      return false;
  102|   589k|    }
  103|  1.25k|    *out_face_edge =
  104|  1.25k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.25k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.25k|    topology_split_data_.pop_back();
  108|  1.25k|    return true;
  109|   590k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  82.3M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  82.3M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  82.3M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  82.3M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  14.9k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

_ZN5draco13HoleEventDataC2Ev:
  118|  1.20M|  HoleEventData() : symbol_id(0) {}

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  11.7k|      : attribute_connectivity_decoders_(nullptr),
   34|  11.7k|        num_attribute_data_(0),
   35|  11.7k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  9.77k|  void Init(MeshEdgebreakerDecoderImplInterface* decoder) {
   37|  9.77k|    decoder_impl_ = decoder;
   38|  9.77k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  9.77k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  9.77k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  9.77k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  6.50k|  uint16_t BitstreamVersion() const {
   45|  6.50k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  6.50k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  4.16k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  9.77k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  7.02k|  bool Start(DecoderBuffer* out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  7.02k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 185, False: 6.83k]
  ------------------
   63|    185|      return false;
   64|    185|    }
   65|       |
   66|  6.83k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 141, False: 6.69k]
  ------------------
   67|    141|      return false;
   68|    141|    }
   69|       |
   70|  6.69k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 39, False: 6.65k]
  ------------------
   71|     39|      return false;
   72|     39|    }
   73|  6.65k|    *out_buffer = buffer_;
   74|  6.65k|    return true;
   75|  6.69k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  6.12M|  inline bool DecodeStartFaceConfiguration() {
   79|  6.12M|    uint32_t face_configuration;
   80|  6.12M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  6.12M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.12M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 814, False: 6.12M]
  ------------------
   82|    814|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    814|    } else
   85|  6.12M|#endif
   86|  6.12M|    {
   87|  6.12M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  6.12M|    }
   89|  6.12M|    return face_configuration;
   90|  6.12M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  12.0M|  inline uint32_t DecodeSymbol() {
   94|  12.0M|    uint32_t symbol;
   95|  12.0M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  12.0M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 5.27M, False: 6.80M]
  ------------------
   97|  5.27M|      return symbol;
   98|  5.27M|    }
   99|       |    // Else decode two additional bits.
  100|  6.80M|    uint32_t symbol_suffix;
  101|  6.80M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  6.80M|    symbol |= (symbol_suffix << 1);
  103|  6.80M|    return symbol;
  104|  12.0M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  11.9M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  1.17M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  26.5M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  26.5M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  26.5M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  6.20k|  void Done() {
  123|  6.20k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 5.93k, False: 266]
  ------------------
  124|  5.93k|      symbol_buffer_.EndBitDecoding();
  125|  5.93k|    }
  126|  6.20k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  6.20k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.20k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 355, False: 5.84k]
  ------------------
  128|    355|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    355|    } else
  131|  5.84k|#endif
  132|  5.84k|    {
  133|  5.84k|      start_face_decoder_.EndDecoding();
  134|  5.84k|    }
  135|  6.20k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  2.44k|  DecoderBuffer* buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  7.35k|  bool DecodeTraversalSymbols() {
  141|  7.35k|    uint64_t traversal_size;
  142|  7.35k|    symbol_buffer_ = buffer_;
  143|  7.35k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 61, False: 7.29k]
  ------------------
  144|     61|      return false;
  145|     61|    }
  146|  7.29k|    buffer_ = symbol_buffer_;
  147|  7.29k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 240, False: 7.05k]
  ------------------
  148|    240|      return false;
  149|    240|    }
  150|  7.05k|    buffer_.Advance(traversal_size);
  151|  7.05k|    return true;
  152|  7.29k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  9.47k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  9.47k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  9.47k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  9.47k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 719, False: 8.75k]
  ------------------
  158|    719|      start_face_buffer_ = buffer_;
  159|    719|      uint64_t traversal_size;
  160|    719|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 6, False: 713]
  ------------------
  161|      6|        return false;
  162|      6|      }
  163|    713|      buffer_ = start_face_buffer_;
  164|    713|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 213, False: 500]
  ------------------
  165|    213|        return false;
  166|    213|      }
  167|    500|      buffer_.Advance(traversal_size);
  168|    500|      return true;
  169|    713|    }
  170|  8.75k|#endif
  171|  8.75k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  9.47k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  9.18k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  9.18k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 6.44k, False: 2.74k]
  ------------------
  177|  6.44k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  6.44k|          new BinaryDecoder[num_attribute_data_]);
  179|  18.3k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 11.9k, False: 6.36k]
  ------------------
  180|  11.9k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 74, False: 11.9k]
  ------------------
  181|     74|          return false;
  182|     74|        }
  183|  11.9k|      }
  184|  6.44k|    }
  185|  9.10k|    return true;
  186|  9.18k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  6.38k|MeshSequentialDecoder::MeshSequentialDecoder() = default;
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  6.13k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  6.13k|  uint32_t num_faces;
   31|  6.13k|  uint32_t num_points;
   32|  6.13k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  6.13k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.13k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 688, False: 5.44k]
  ------------------
   34|    688|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 10, False: 678]
  ------------------
   35|     10|      return false;
   36|     10|    }
   37|    678|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 3, False: 675]
  ------------------
   38|      3|      return false;
   39|      3|    }
   40|       |
   41|    678|  } else
   42|  5.44k|#endif
   43|  5.44k|  {
   44|  5.44k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 14, False: 5.43k]
  ------------------
   45|     14|      return false;
   46|     14|    }
   47|  5.43k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 10, False: 5.42k]
  ------------------
   48|     10|      return false;
   49|     10|    }
   50|  5.43k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  6.10k|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|  6.10k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 4, False: 6.09k]
  ------------------
   56|      4|    return false;
   57|      4|  }
   58|  6.09k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 52, False: 6.04k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|     52|    return false;
   62|     52|  }
   63|  6.04k|  uint8_t connectivity_method;
   64|  6.04k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 3, False: 6.04k]
  ------------------
   65|      3|    return false;
   66|      3|  }
   67|  6.04k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 4.79k, False: 1.24k]
  ------------------
   68|  4.79k|    if (!DecodeAndDecompressIndices(num_faces, num_points)) {
  ------------------
  |  Branch (68:9): [True: 4.60k, False: 195]
  ------------------
   69|  4.60k|      return false;
   70|  4.60k|    }
   71|  4.79k|  } else {
   72|  1.24k|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 803, False: 440]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  3.84k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 3.07k, False: 773]
  ------------------
   75|  3.07k|        Mesh::Face face;
   76|  12.2k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 9.20k, False: 3.04k]
  ------------------
   77|  9.20k|          uint8_t val;
   78|  9.20k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 17, False: 9.18k]
  ------------------
   79|     17|            return false;
   80|     17|          }
   81|  9.18k|          if (val >= num_points) {
  ------------------
  |  Branch (81:15): [True: 13, False: 9.17k]
  ------------------
   82|     13|            return false;
   83|     13|          }
   84|  9.17k|          face[j] = val;
   85|  9.17k|        }
   86|  3.04k|        mesh()->AddFace(face);
   87|  3.04k|      }
   88|    803|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (88:16): [True: 114, False: 326]
  ------------------
   89|       |      // Decode indices as uint16_t.
   90|    393|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:28): [True: 365, False: 28]
  ------------------
   91|    365|        Mesh::Face face;
   92|  1.27k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (92:25): [True: 1.00k, False: 279]
  ------------------
   93|  1.00k|          uint16_t val;
   94|  1.00k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (94:15): [True: 44, False: 956]
  ------------------
   95|     44|            return false;
   96|     44|          }
   97|    956|          if (val >= num_points) {
  ------------------
  |  Branch (97:15): [True: 42, False: 914]
  ------------------
   98|     42|            return false;
   99|     42|          }
  100|    914|          face[j] = val;
  101|    914|        }
  102|    279|        mesh()->AddFace(face);
  103|    279|      }
  104|    326|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (104:16): [True: 150, False: 176]
  ------------------
  105|    150|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    150|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (105:16): [True: 143, False: 7]
  ------------------
  106|       |      // Decode indices as uint32_t.
  107|  1.12k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (107:28): [True: 1.08k, False: 45]
  ------------------
  108|  1.08k|        Mesh::Face face;
  109|  4.15k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (109:25): [True: 3.16k, False: 986]
  ------------------
  110|  3.16k|          uint32_t val;
  111|  3.16k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (111:15): [True: 31, False: 3.13k]
  ------------------
  112|     31|            return false;
  113|     31|          }
  114|  3.13k|          if (val >= num_points) {
  ------------------
  |  Branch (114:15): [True: 67, False: 3.06k]
  ------------------
  115|     67|            return false;
  116|     67|          }
  117|  3.06k|          face[j] = val;
  118|  3.06k|        }
  119|    986|        mesh()->AddFace(face);
  120|    986|      }
  121|    183|    } else {
  122|       |      // Decode faces as uint32_t (default).
  123|    732|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (123:28): [True: 687, False: 45]
  ------------------
  124|    687|        Mesh::Face face;
  125|  2.42k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (125:25): [True: 1.87k, False: 549]
  ------------------
  126|  1.87k|          uint32_t val;
  127|  1.87k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (127:15): [True: 79, False: 1.79k]
  ------------------
  128|     79|            return false;
  129|     79|          }
  130|  1.79k|          if (val >= num_points) {
  ------------------
  |  Branch (130:15): [True: 59, False: 1.73k]
  ------------------
  131|     59|            return false;
  132|     59|          }
  133|  1.73k|          face[j] = val;
  134|  1.73k|        }
  135|    549|        mesh()->AddFace(face);
  136|    549|      }
  137|    183|    }
  138|  1.24k|  }
  139|  1.08k|  point_cloud()->set_num_points(num_points);
  140|  1.08k|  return true;
  141|  6.04k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  143|  24.6k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  144|       |  // Always create the basic attribute decoder.
  145|  24.6k|  return SetAttributesDecoder(
  146|  24.6k|      att_decoder_id,
  147|  24.6k|      std::unique_ptr<AttributesDecoder>(
  148|  24.6k|          new SequentialAttributeDecodersController(
  149|  24.6k|              std::unique_ptr<PointsSequencer>(
  150|  24.6k|                  new LinearSequencer(point_cloud()->num_points())))));
  151|  24.6k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEjj:
  154|  4.79k|                                                       uint32_t num_points) {
  155|       |  // Get decoded indices differences that were encoded with an entropy code.
  156|  4.79k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  157|  4.79k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (157:7): [True: 4.35k, False: 440]
  ------------------
  158|  4.35k|    return false;
  159|  4.35k|  }
  160|       |  // Reconstruct the indices from the differences.
  161|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  162|    440|  int32_t last_index_value = 0;  // This will always be >= 0.
  163|    440|  int vertex_index = 0;
  164|  1.80k|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (164:24): [True: 1.61k, False: 195]
  ------------------
  165|  1.61k|    Mesh::Face face;
  166|  5.84k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (166:21): [True: 4.47k, False: 1.36k]
  ------------------
  167|  4.47k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  168|  4.47k|      int32_t index_diff = (encoded_val >> 1);
  169|  4.47k|      if (encoded_val & 1) {
  ------------------
  |  Branch (169:11): [True: 1.29k, False: 3.18k]
  ------------------
  170|  1.29k|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (170:13): [True: 100, False: 1.19k]
  ------------------
  171|       |          // Subtracting index_diff would result in a negative index.
  172|    100|          return false;
  173|    100|        }
  174|  1.19k|        index_diff = -index_diff;
  175|  3.18k|      } else {
  176|  3.18k|        if (index_diff >
  ------------------
  |  Branch (176:13): [True: 0, False: 3.18k]
  ------------------
  177|  3.18k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  178|       |          // Adding index_diff to last_index_value would overflow.
  179|      0|          return false;
  180|      0|        }
  181|  3.18k|      }
  182|  4.37k|      const int32_t index_value = index_diff + last_index_value;
  183|  4.37k|      if (index_value < 0 || static_cast<uint32_t>(index_value) >= num_points) {
  ------------------
  |  Branch (183:11): [True: 0, False: 4.37k]
  |  Branch (183:30): [True: 145, False: 4.23k]
  ------------------
  184|    145|        return false;
  185|    145|      }
  186|  4.23k|      face[j] = index_value;
  187|  4.23k|      last_index_value = index_value;
  188|  4.23k|    }
  189|  1.36k|    mesh()->AddFace(face);
  190|  1.36k|  }
  191|    195|  return true;
  192|    440|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  2.07k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.25M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.25M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 3.25M, False: 6.58k]
  ------------------
   61|  3.25M|      return true;  // Already traversed.
   62|  3.25M|    }
   63|       |
   64|  6.58k|    corner_traversal_stack_.clear();
   65|  6.58k|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  6.58k|    const VertexIndex next_vert =
   69|  6.58k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  6.58k|    const VertexIndex prev_vert =
   71|  6.58k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  6.58k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 6.58k]
  |  Branch (72:45): [True: 0, False: 6.58k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  6.58k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 5.06k, False: 1.52k]
  ------------------
   76|  5.06k|      this->MarkVertexVisited(next_vert);
   77|  5.06k|      this->traversal_observer().OnNewVertexVisited(
   78|  5.06k|          next_vert, this->corner_table()->Next(corner_id));
   79|  5.06k|    }
   80|  6.58k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 5.34k, False: 1.23k]
  ------------------
   81|  5.34k|      this->MarkVertexVisited(prev_vert);
   82|  5.34k|      this->traversal_observer().OnNewVertexVisited(
   83|  5.34k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  5.34k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  30.2k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 23.6k, False: 6.58k]
  ------------------
   88|       |      // Currently processed corner.
   89|  23.6k|      corner_id = corner_traversal_stack_.back();
   90|  23.6k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  23.6k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 23.6k]
  |  Branch (92:47): [True: 1.00k, False: 22.6k]
  ------------------
   93|       |        // This face has been already traversed.
   94|  1.00k|        corner_traversal_stack_.pop_back();
   95|  1.00k|        continue;
   96|  1.00k|      }
   97|  3.25M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.25M, Folded]
  ------------------
   98|  3.25M|        this->MarkFaceVisited(face_id);
   99|  3.25M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.25M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.25M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.25M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.25M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.64M, False: 1.61M]
  ------------------
  105|  1.64M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.64M|          this->MarkVertexVisited(vert_id);
  107|  1.64M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.64M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.60M, False: 40.8k]
  ------------------
  109|  1.60M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.60M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.60M|            continue;
  112|  1.60M|          }
  113|  1.64M|        }
  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.65M|        const CornerIndex right_corner_id =
  118|  1.65M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.65M|        const CornerIndex left_corner_id =
  120|  1.65M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.65M|        const FaceIndex right_face_id(
  122|  1.65M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 28.7k, False: 1.62M]
  ------------------
  123|  1.65M|                 ? kInvalidFaceIndex
  124|  1.65M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.65M|        const FaceIndex left_face_id(
  126|  1.65M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 17.0k, False: 1.63M]
  ------------------
  127|  1.65M|                 ? kInvalidFaceIndex
  128|  1.65M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.65M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.61M, False: 41.4k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.61M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 14.1k, False: 1.59M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  14.1k|            corner_traversal_stack_.pop_back();
  134|  14.1k|            break;  // Break from the while (true) loop.
  135|  1.59M|          } else {
  136|       |            // Go to the left face.
  137|  1.59M|            corner_id = left_corner_id;
  138|  1.59M|            face_id = left_face_id;
  139|  1.59M|          }
  140|  1.61M|        } else {
  141|       |          // Right face was not visited.
  142|  41.4k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 32.9k, False: 8.52k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  32.9k|            corner_id = right_corner_id;
  145|  32.9k|            face_id = right_face_id;
  146|  32.9k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  8.52k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  8.52k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  8.52k|            break;
  159|  8.52k|          }
  160|  41.4k|        }
  161|  1.65M|      }
  162|  22.6k|    }
  163|  6.58k|    return true;
  164|  6.58k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  2.07k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  4.29k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  2.59k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  5.17M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  5.17M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 959k, False: 4.21M]
  ------------------
   61|   959k|      return true;  // Already traversed.
   62|   959k|    }
   63|       |
   64|  4.21M|    corner_traversal_stack_.clear();
   65|  4.21M|    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|  4.21M|    const VertexIndex next_vert =
   69|  4.21M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  4.21M|    const VertexIndex prev_vert =
   71|  4.21M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  4.21M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 4.21M]
  |  Branch (72:45): [True: 0, False: 4.21M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  4.21M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 4.21M, False: 1.62k]
  ------------------
   76|  4.21M|      this->MarkVertexVisited(next_vert);
   77|  4.21M|      this->traversal_observer().OnNewVertexVisited(
   78|  4.21M|          next_vert, this->corner_table()->Next(corner_id));
   79|  4.21M|    }
   80|  4.21M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 4.21M, False: 1.82k]
  ------------------
   81|  4.21M|      this->MarkVertexVisited(prev_vert);
   82|  4.21M|      this->traversal_observer().OnNewVertexVisited(
   83|  4.21M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  4.21M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  8.52M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 4.30M, False: 4.21M]
  ------------------
   88|       |      // Currently processed corner.
   89|  4.30M|      corner_id = corner_traversal_stack_.back();
   90|  4.30M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  4.30M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 4.30M]
  |  Branch (92:47): [True: 6.17k, False: 4.29M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  6.17k|        corner_traversal_stack_.pop_back();
   95|  6.17k|        continue;
   96|  6.17k|      }
   97|  5.17M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 5.17M, Folded]
  ------------------
   98|  5.17M|        this->MarkFaceVisited(face_id);
   99|  5.17M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  5.17M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  5.17M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 5.17M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  5.17M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 4.72M, False: 455k]
  ------------------
  105|  4.72M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  4.72M|          this->MarkVertexVisited(vert_id);
  107|  4.72M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  4.72M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 437k, False: 4.28M]
  ------------------
  109|   437k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   437k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   437k|            continue;
  112|   437k|          }
  113|  4.72M|        }
  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|  4.74M|        const CornerIndex right_corner_id =
  118|  4.74M|            this->corner_table()->GetRightCorner(corner_id);
  119|  4.74M|        const CornerIndex left_corner_id =
  120|  4.74M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  4.74M|        const FaceIndex right_face_id(
  122|  4.74M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 4.25M, False: 485k]
  ------------------
  123|  4.74M|                 ? kInvalidFaceIndex
  124|  4.74M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  4.74M|        const FaceIndex left_face_id(
  126|  4.74M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 4.24M, False: 491k]
  ------------------
  127|  4.74M|                 ? kInvalidFaceIndex
  128|  4.74M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  4.74M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 4.67M, False: 63.5k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  4.67M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 4.25M, False: 423k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  4.25M|            corner_traversal_stack_.pop_back();
  134|  4.25M|            break;  // Break from the while (true) loop.
  135|  4.25M|          } else {
  136|       |            // Go to the left face.
  137|   423k|            corner_id = left_corner_id;
  138|   423k|            face_id = left_face_id;
  139|   423k|          }
  140|  4.67M|        } else {
  141|       |          // Right face was not visited.
  142|  63.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 22.6k, False: 40.8k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  22.6k|            corner_id = right_corner_id;
  145|  22.6k|            face_id = right_face_id;
  146|  40.8k|          } 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|  40.8k|            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|  40.8k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  40.8k|            break;
  159|  40.8k|          }
  160|  63.5k|        }
  161|  4.74M|      }
  162|  4.29M|    }
  163|  4.21M|    return true;
  164|  4.21M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  2.59k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  5.30k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    713|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.29k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  1.29k|    const auto* corner_table = traverser_.corner_table();
   50|  1.29k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.29k|    const size_t num_faces = mesh_->num_faces();
   52|  1.29k|    const size_t num_points = mesh_->num_points();
   53|  7.04M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 7.04M, False: 1.29k]
  ------------------
   54|  7.04M|      const auto& face = mesh_->face(f);
   55|  28.1M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 21.1M, False: 7.04M]
  ------------------
   56|  21.1M|        const PointIndex point_id = face[p];
   57|  21.1M|        const VertexIndex vert_id =
   58|  21.1M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  21.1M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 21.1M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  21.1M|        const AttributeValueIndex att_entry_id(
   63|  21.1M|            encoding_data_
   64|  21.1M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  21.1M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 21.1M]
  |  Branch (65:13): [True: 0, False: 21.1M]
  |  Branch (65:39): [True: 0, False: 21.1M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  21.1M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  21.1M|      }
   71|  7.04M|    }
   72|  1.29k|    return true;
   73|  1.29k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    677|  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|    677|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    677|    traverser_.OnTraversalStart();
   82|    677|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 677]
  ------------------
   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|    677|    } else {
   89|    677|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  4.68M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 4.68M, False: 677]
  ------------------
   91|  4.68M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 4.68M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  4.68M|      }
   95|    677|    }
   96|    677|    traverser_.OnTraversalEnd();
   97|    677|    return true;
   98|    677|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  4.68M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  4.68M|    return traverser_.TraverseFromCorner(corner_id);
  103|  4.68M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    713|  void SetTraverser(const TraverserT& t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  2.14k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  9.74k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  9.74k|    const auto* corner_table = traverser_.corner_table();
   50|  9.74k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  9.74k|    const size_t num_faces = mesh_->num_faces();
   52|  9.74k|    const size_t num_points = mesh_->num_points();
   53|  5.25M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.24M, False: 9.74k]
  ------------------
   54|  5.24M|      const auto& face = mesh_->face(f);
   55|  20.9M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 15.7M, False: 5.24M]
  ------------------
   56|  15.7M|        const PointIndex point_id = face[p];
   57|  15.7M|        const VertexIndex vert_id =
   58|  15.7M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  15.7M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 15.7M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  15.7M|        const AttributeValueIndex att_entry_id(
   63|  15.7M|            encoding_data_
   64|  15.7M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  15.7M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 15.7M]
  |  Branch (65:13): [True: 0, False: 15.7M]
  |  Branch (65:39): [True: 0, False: 15.7M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  15.7M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  15.7M|      }
   71|  5.24M|    }
   72|  9.74k|    return true;
   73|  9.74k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  2.07k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  2.07k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  2.07k|    traverser_.OnTraversalStart();
   82|  2.07k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 2.07k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  2.07k|    } else {
   89|  2.07k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.26M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.25M, False: 2.07k]
  ------------------
   91|  3.25M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.25M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.25M|      }
   95|  2.07k|    }
   96|  2.07k|    traverser_.OnTraversalEnd();
   97|  2.07k|    return true;
   98|  2.07k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.25M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.25M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.25M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  2.14k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  2.65k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  11.6k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  11.6k|    const auto* corner_table = traverser_.corner_table();
   50|  11.6k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  11.6k|    const size_t num_faces = mesh_->num_faces();
   52|  11.6k|    const size_t num_points = mesh_->num_points();
   53|  8.58M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 8.56M, False: 11.6k]
  ------------------
   54|  8.56M|      const auto& face = mesh_->face(f);
   55|  34.2M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 25.7M, False: 8.56M]
  ------------------
   56|  25.7M|        const PointIndex point_id = face[p];
   57|  25.7M|        const VertexIndex vert_id =
   58|  25.7M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  25.7M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 25.7M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  25.7M|        const AttributeValueIndex att_entry_id(
   63|  25.7M|            encoding_data_
   64|  25.7M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  25.7M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 25.7M]
  |  Branch (65:13): [True: 1, False: 25.7M]
  |  Branch (65:39): [True: 1, False: 25.7M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      1|          return false;
   68|      1|        }
   69|  25.7M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  25.7M|      }
   71|  8.56M|    }
   72|  11.6k|    return true;
   73|  11.6k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  2.59k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  2.59k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  2.59k|    traverser_.OnTraversalStart();
   82|  2.59k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 2.59k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  2.59k|    } else {
   89|  2.59k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  5.18M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 5.17M, False: 2.59k]
  ------------------
   91|  5.17M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 5.17M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  5.17M|      }
   95|  2.59k|    }
   96|  2.59k|    traverser_.OnTraversalEnd();
   97|  2.59k|    return true;
   98|  2.59k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  5.17M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  5.17M|    return traverser_.TraverseFromCorner(corner_id);
  103|  5.17M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  2.65k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  5.30k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  54.3M|  inline const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  29.0M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  29.0M|    return is_vertex_visited_[vert_id.value()];
   65|  29.0M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  4.03M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  4.03M|    is_vertex_visited_[vert_id.value()] = true;
   68|  4.03M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  11.9M|  inline TraversalObserverT& traversal_observer() {
   75|  11.9M|    return traversal_observer_;
   76|  11.9M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  21.9M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  21.9M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 105k, False: 21.8M]
  ------------------
   47|   105k|      return true;  // Invalid faces are always considered as visited.
   48|   105k|    }
   49|  21.8M|    return is_face_visited_[face_id.value()];
   50|  21.9M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  7.94M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  7.94M|    is_face_visited_[face_id.value()] = true;
   62|  7.94M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  5.71k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  5.71k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.85k|                    TraversalObserver traversal_observer) {
   37|  2.85k|    corner_table_ = corner_table;
   38|  2.85k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.85k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.85k|    traversal_observer_ = traversal_observer;
   41|  2.85k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.25M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.25M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.25M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.25M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.25M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  45.1M|  inline const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  5.17M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  5.17M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 5.17M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  5.17M|    return is_face_visited_[corner_id.value() / 3];
   58|  5.17M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  13.6M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  13.6M|    return is_vertex_visited_[vert_id.value()];
   65|  13.6M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  13.1M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  13.1M|    is_vertex_visited_[vert_id.value()] = true;
   68|  13.1M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  18.3M|  inline TraversalObserverT& traversal_observer() {
   75|  18.3M|    return traversal_observer_;
   76|  18.3M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  13.7M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  13.7M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 8.50M, False: 5.27M]
  ------------------
   47|  8.50M|      return true;  // Invalid faces are always considered as visited.
   48|  8.50M|    }
   49|  5.27M|    return is_face_visited_[face_id.value()];
   50|  13.7M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  5.17M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  5.17M|    is_face_visited_[face_id.value()] = true;
   62|  5.17M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  5.30k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.65k|                    TraversalObserver traversal_observer) {
   37|  2.65k|    corner_table_ = corner_table;
   38|  2.65k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.65k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.65k|    traversal_observer_ = traversal_observer;
   41|  2.65k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    568|      : bit_length_(0),
   87|    568|        num_points_(0),
   88|    568|        num_decoded_points_(0),
   89|    568|        dimension_(dimension),
   90|    568|        p_(dimension, 0),
   91|    568|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    393|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    393|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 25, False: 368]
  ------------------
  197|     25|    return false;
  198|     25|  }
  199|    368|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 53, False: 315]
  ------------------
  200|     53|    return false;
  201|     53|  }
  202|    315|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 7, False: 308]
  ------------------
  203|      7|    return false;
  204|      7|  }
  205|    308|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 127, False: 181]
  ------------------
  206|    127|    return true;
  207|    127|  }
  208|    181|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 69, False: 112]
  ------------------
  209|     69|    return false;
  210|     69|  }
  211|    112|  num_decoded_points_ = 0;
  212|       |
  213|    112|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 19, False: 93]
  ------------------
  214|     19|    return false;
  215|     19|  }
  216|     93|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 4, False: 89]
  ------------------
  217|      4|    return false;
  218|      4|  }
  219|     89|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 2, False: 87]
  ------------------
  220|      2|    return false;
  221|      2|  }
  222|     87|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 85]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     85|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 65, False: 20]
  ------------------
  227|     65|    return false;
  228|     65|  }
  229|       |
  230|     20|  numbers_decoder_.EndDecoding();
  231|     20|  remaining_bits_decoder_.EndDecoding();
  232|     20|  axis_decoder_.EndDecoding();
  233|     20|  half_decoder_.EndDecoding();
  234|       |
  235|     20|  return true;
  236|     85|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     85|    uint32_t num_points, OutputIteratorT& oit) {
  264|     85|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     85|  base_.assign(dimension_, 0);
  278|     85|  levels_.assign(dimension_, 0);
  279|     85|  undo_.clear();
  280|     85|  uint32_t depth = 0;
  281|     85|  DecodingStatus init_status(num_points, 0, 0);
  282|     85|  std::stack<Status> status_stack;
  283|     85|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  6.32M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 6.32M, False: 20]
  ------------------
  287|  6.32M|    const DecodingStatus status = status_stack.top();
  288|  6.32M|    status_stack.pop();
  289|       |
  290|  6.32M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  6.32M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  6.32M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 3.15M, False: 3.16M]
  ------------------
  295|  3.15M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 3.15M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  6.31M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 6.31M, False: 0]
  ------------------
  299|  6.31M|        const SplitUndo& split = undo_.back();
  300|  6.31M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 6.31M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  6.31M|        base_[split.axis] = split.old_base;
  304|  6.31M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 3.15M, False: 3.15M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  3.15M|          break;
  307|  3.15M|        }
  308|  3.15M|        levels_[split.axis] = split.old_level;
  309|  3.15M|        undo_.pop_back();
  310|  3.15M|      }
  311|  3.15M|      depth = status.depth;
  312|  3.15M|    }
  313|  6.32M|    const VectorUint32& old_base = base_;
  314|  6.32M|    const VectorUint32& levels = levels_;
  315|       |
  316|  6.32M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 6.32M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  6.32M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  6.32M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 6.32M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  6.32M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  6.32M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 3.15M, False: 3.16M]
  ------------------
  329|  34.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 31.4M, False: 3.15M]
  ------------------
  330|  31.4M|        *oit = old_base;
  331|  31.4M|        ++oit;
  332|  31.4M|        ++num_decoded_points_;
  333|  31.4M|      }
  334|  3.15M|      continue;
  335|  3.15M|    }
  336|       |
  337|  3.16M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  3.16M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 693, False: 3.16M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    693|      axes_[0] = axis;
  344|  2.27k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 1.58k, False: 693]
  ------------------
  345|  1.58k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.58k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 226, False: 1.35k]
  |  |  ------------------
  ------------------
  346|  1.58k|      }
  347|  1.84k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.18k, False: 658]
  ------------------
  348|  4.19k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 3.04k, False: 1.15k]
  ------------------
  349|  3.04k|          p_[axes_[j]] = 0;
  350|  3.04k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  3.04k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 1.89k, False: 1.14k]
  ------------------
  352|  1.89k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 35, False: 1.86k]
  ------------------
  353|  1.89k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     35|              return false;
  355|     35|            }
  356|  1.89k|          }
  357|  3.01k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  3.01k|        }
  359|  1.15k|        *oit = p_;
  360|  1.15k|        ++oit;
  361|  1.15k|        ++num_decoded_points_;
  362|  1.15k|      }
  363|    658|      continue;
  364|    693|    }
  365|       |
  366|  3.16M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 3.16M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  3.16M|    const int num_remaining_bits = bit_length_ - level;
  371|  3.16M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  3.16M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  3.16M|    uint32_t number = 0;
  376|  3.16M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  3.16M|    uint32_t first_half = num_remaining_points / 2;
  379|  3.16M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 30, False: 3.16M]
  ------------------
  380|       |      // Invalid |number|.
  381|     30|      return false;
  382|     30|    }
  383|  3.16M|    first_half -= number;
  384|  3.16M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  3.16M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.78M, False: 1.37M]
  ------------------
  387|  1.78M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.78M, False: 2.45k]
  ------------------
  388|  1.78M|        std::swap(first_half, second_half);
  389|  1.78M|      }
  390|  1.78M|    }
  391|       |
  392|  3.16M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 3.16M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  3.16M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  3.16M|    levels_[axis] += 1;
  400|  3.16M|    base_[axis] += modifier;
  401|  3.16M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 3.16M, False: 51]
  ------------------
  402|  3.16M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  3.16M|    }
  404|  3.16M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 3.16M, False: 64]
  ------------------
  405|  3.16M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  3.16M|    }
  407|  3.16M|    ++depth;
  408|  3.16M|  }
  409|     20|  return true;
  410|     85|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  130|  7.27M|        : num_remaining_points(num_remaining_points_),
  131|  7.27M|          last_axis(last_axis_),
  132|  7.27M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  123|  3.63M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  3.63M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  3.63M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  114|    147|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    483|      : bit_length_(0),
   87|    483|        num_points_(0),
   88|    483|        num_decoded_points_(0),
   89|    483|        dimension_(dimension),
   90|    483|        p_(dimension, 0),
   91|    483|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    323|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    323|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 19, False: 304]
  ------------------
  197|     19|    return false;
  198|     19|  }
  199|    304|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 58, False: 246]
  ------------------
  200|     58|    return false;
  201|     58|  }
  202|    246|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 3, False: 243]
  ------------------
  203|      3|    return false;
  204|      3|  }
  205|    243|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 59, False: 184]
  ------------------
  206|     59|    return true;
  207|     59|  }
  208|    184|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 62, False: 122]
  ------------------
  209|     62|    return false;
  210|     62|  }
  211|    122|  num_decoded_points_ = 0;
  212|       |
  213|    122|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 18, False: 104]
  ------------------
  214|     18|    return false;
  215|     18|  }
  216|    104|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 9, False: 95]
  ------------------
  217|      9|    return false;
  218|      9|  }
  219|     95|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 2, False: 93]
  ------------------
  220|      2|    return false;
  221|      2|  }
  222|     93|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 92]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|     92|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 64, False: 28]
  ------------------
  227|     64|    return false;
  228|     64|  }
  229|       |
  230|     28|  numbers_decoder_.EndDecoding();
  231|     28|  remaining_bits_decoder_.EndDecoding();
  232|     28|  axis_decoder_.EndDecoding();
  233|     28|  half_decoder_.EndDecoding();
  234|       |
  235|     28|  return true;
  236|     92|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     92|    uint32_t num_points, OutputIteratorT& oit) {
  264|     92|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     92|  base_.assign(dimension_, 0);
  278|     92|  levels_.assign(dimension_, 0);
  279|     92|  undo_.clear();
  280|     92|  uint32_t depth = 0;
  281|     92|  DecodingStatus init_status(num_points, 0, 0);
  282|     92|  std::stack<Status> status_stack;
  283|     92|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  8.56M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 8.56M, False: 28]
  ------------------
  287|  8.56M|    const DecodingStatus status = status_stack.top();
  288|  8.56M|    status_stack.pop();
  289|       |
  290|  8.56M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  8.56M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  8.56M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 4.28M, False: 4.28M]
  ------------------
  295|  4.28M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 4.28M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  8.56M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 8.56M, False: 0]
  ------------------
  299|  8.56M|        const SplitUndo& split = undo_.back();
  300|  8.56M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 8.56M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  8.56M|        base_[split.axis] = split.old_base;
  304|  8.56M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 4.28M, False: 4.28M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  4.28M|          break;
  307|  4.28M|        }
  308|  4.28M|        levels_[split.axis] = split.old_level;
  309|  4.28M|        undo_.pop_back();
  310|  4.28M|      }
  311|  4.28M|      depth = status.depth;
  312|  4.28M|    }
  313|  8.56M|    const VectorUint32& old_base = base_;
  314|  8.56M|    const VectorUint32& levels = levels_;
  315|       |
  316|  8.56M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 8.56M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  8.56M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  8.56M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 8.56M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  8.56M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  8.56M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 4.28M, False: 4.28M]
  ------------------
  329|  54.3M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 50.0M, False: 4.28M]
  ------------------
  330|  50.0M|        *oit = old_base;
  331|  50.0M|        ++oit;
  332|  50.0M|        ++num_decoded_points_;
  333|  50.0M|      }
  334|  4.28M|      continue;
  335|  4.28M|    }
  336|       |
  337|  4.28M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  4.28M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 780, False: 4.28M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    780|      axes_[0] = axis;
  344|  3.97k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 3.19k, False: 780]
  ------------------
  345|  3.19k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  3.19k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 192, False: 3.00k]
  |  |  ------------------
  ------------------
  346|  3.19k|      }
  347|  2.10k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.36k, False: 741]
  ------------------
  348|  6.70k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 5.38k, False: 1.32k]
  ------------------
  349|  5.38k|          p_[axes_[j]] = 0;
  350|  5.38k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  5.38k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 2.38k, False: 2.99k]
  ------------------
  352|  2.38k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 39, False: 2.34k]
  ------------------
  353|  2.38k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     39|              return false;
  355|     39|            }
  356|  2.38k|          }
  357|  5.34k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  5.34k|        }
  359|  1.32k|        *oit = p_;
  360|  1.32k|        ++oit;
  361|  1.32k|        ++num_decoded_points_;
  362|  1.32k|      }
  363|    741|      continue;
  364|    780|    }
  365|       |
  366|  4.28M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 4.28M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  4.28M|    const int num_remaining_bits = bit_length_ - level;
  371|  4.28M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  4.28M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  4.28M|    uint32_t number = 0;
  376|  4.28M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  4.28M|    uint32_t first_half = num_remaining_points / 2;
  379|  4.28M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 25, False: 4.28M]
  ------------------
  380|       |      // Invalid |number|.
  381|     25|      return false;
  382|     25|    }
  383|  4.28M|    first_half -= number;
  384|  4.28M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  4.28M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.91M, False: 2.36M]
  ------------------
  387|  1.91M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.91M, False: 3.11k]
  ------------------
  388|  1.91M|        std::swap(first_half, second_half);
  389|  1.91M|      }
  390|  1.91M|    }
  391|       |
  392|  4.28M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 4.28M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  4.28M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  4.28M|    levels_[axis] += 1;
  400|  4.28M|    base_[axis] += modifier;
  401|  4.28M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 4.28M, False: 30]
  ------------------
  402|  4.28M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  4.28M|    }
  404|  4.28M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 4.28M, False: 63]
  ------------------
  405|  4.28M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  4.28M|    }
  407|  4.28M|    ++depth;
  408|  4.28M|  }
  409|     28|  return true;
  410|     92|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  130|  10.5M|        : num_remaining_points(num_remaining_points_),
  131|  10.5M|          last_axis(last_axis_),
  132|  10.5M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  10.5M|    uint32_t last_axis) {
  242|  10.5M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 10.5M, Folded]
  ------------------
  243|  10.5M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  10.5M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 8.99M, False: 1.52M]
  |  |  ------------------
  ------------------
  244|  10.5M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  10.5M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  123|  5.26M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  5.26M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  5.26M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  114|     87|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    383|      : bit_length_(0),
   87|    383|        num_points_(0),
   88|    383|        num_decoded_points_(0),
   89|    383|        dimension_(dimension),
   90|    383|        p_(dimension, 0),
   91|    383|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    231|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    231|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 10, False: 221]
  ------------------
  197|     10|    return false;
  198|     10|  }
  199|    221|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 30, False: 191]
  ------------------
  200|     30|    return false;
  201|     30|  }
  202|    191|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 3, False: 188]
  ------------------
  203|      3|    return false;
  204|      3|  }
  205|    188|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 29, False: 159]
  ------------------
  206|     29|    return true;
  207|     29|  }
  208|    159|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 40, False: 119]
  ------------------
  209|     40|    return false;
  210|     40|  }
  211|    119|  num_decoded_points_ = 0;
  212|       |
  213|    119|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 3, False: 116]
  ------------------
  214|      3|    return false;
  215|      3|  }
  216|    116|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 7, False: 109]
  ------------------
  217|      7|    return false;
  218|      7|  }
  219|    109|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 8, False: 101]
  ------------------
  220|      8|    return false;
  221|      8|  }
  222|    101|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 4, False: 97]
  ------------------
  223|      4|    return false;
  224|      4|  }
  225|       |
  226|     97|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 88, False: 9]
  ------------------
  227|     88|    return false;
  228|     88|  }
  229|       |
  230|      9|  numbers_decoder_.EndDecoding();
  231|      9|  remaining_bits_decoder_.EndDecoding();
  232|      9|  axis_decoder_.EndDecoding();
  233|      9|  half_decoder_.EndDecoding();
  234|       |
  235|      9|  return true;
  236|     97|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     97|    uint32_t num_points, OutputIteratorT& oit) {
  264|     97|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     97|  base_.assign(dimension_, 0);
  278|     97|  levels_.assign(dimension_, 0);
  279|     97|  undo_.clear();
  280|     97|  uint32_t depth = 0;
  281|     97|  DecodingStatus init_status(num_points, 0, 0);
  282|     97|  std::stack<Status> status_stack;
  283|     97|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  58.9k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 58.9k, False: 9]
  ------------------
  287|  58.9k|    const DecodingStatus status = status_stack.top();
  288|  58.9k|    status_stack.pop();
  289|       |
  290|  58.9k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  58.9k|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  58.9k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 53.4k, False: 5.43k]
  ------------------
  295|  53.4k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 53.4k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|   110k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 110k, False: 0]
  ------------------
  299|   110k|        const SplitUndo& split = undo_.back();
  300|   110k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 110k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|   110k|        base_[split.axis] = split.old_base;
  304|   110k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 53.4k, False: 56.8k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  53.4k|          break;
  307|  53.4k|        }
  308|  56.8k|        levels_[split.axis] = split.old_level;
  309|  56.8k|        undo_.pop_back();
  310|  56.8k|      }
  311|  53.4k|      depth = status.depth;
  312|  53.4k|    }
  313|  58.9k|    const VectorUint32& old_base = base_;
  314|  58.9k|    const VectorUint32& levels = levels_;
  315|       |
  316|  58.9k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 58.9k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  58.9k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  58.9k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 58.9k]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  58.9k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  58.9k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 831, False: 58.0k]
  ------------------
  329|  24.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 24.9M, False: 831]
  ------------------
  330|  24.9M|        *oit = old_base;
  331|  24.9M|        ++oit;
  332|  24.9M|        ++num_decoded_points_;
  333|  24.9M|      }
  334|    831|      continue;
  335|    831|    }
  336|       |
  337|  58.0k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  58.0k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 464, False: 57.6k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    464|      axes_[0] = axis;
  344|  1.39k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 930, False: 464]
  ------------------
  345|    930|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    930|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 155, False: 775]
  |  |  ------------------
  ------------------
  346|    930|      }
  347|  1.24k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 802, False: 438]
  ------------------
  348|  2.59k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 1.82k, False: 776]
  ------------------
  349|  1.82k|          p_[axes_[j]] = 0;
  350|  1.82k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  1.82k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 1.27k, False: 545]
  ------------------
  352|  1.27k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 26, False: 1.25k]
  ------------------
  353|  1.27k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     26|              return false;
  355|     26|            }
  356|  1.27k|          }
  357|  1.79k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  1.79k|        }
  359|    776|        *oit = p_;
  360|    776|        ++oit;
  361|    776|        ++num_decoded_points_;
  362|    776|      }
  363|    438|      continue;
  364|    464|    }
  365|       |
  366|  57.6k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 57.6k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  57.6k|    const int num_remaining_bits = bit_length_ - level;
  371|  57.6k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  57.6k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  57.6k|    uint32_t number = 0;
  376|  57.6k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  57.6k|    uint32_t first_half = num_remaining_points / 2;
  379|  57.6k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 62, False: 57.5k]
  ------------------
  380|       |      // Invalid |number|.
  381|     62|      return false;
  382|     62|    }
  383|  57.5k|    first_half -= number;
  384|  57.5k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  57.5k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 56.9k, False: 588]
  ------------------
  387|  56.9k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 53.0k, False: 3.96k]
  ------------------
  388|  53.0k|        std::swap(first_half, second_half);
  389|  53.0k|      }
  390|  56.9k|    }
  391|       |
  392|  57.5k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 57.5k]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  57.5k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  57.5k|    levels_[axis] += 1;
  400|  57.5k|    base_[axis] += modifier;
  401|  57.5k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 54.0k, False: 3.50k]
  ------------------
  402|  54.0k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  54.0k|    }
  404|  57.5k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 5.33k, False: 52.2k]
  ------------------
  405|  5.33k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  5.33k|    }
  407|  57.5k|    ++depth;
  408|  57.5k|  }
  409|      9|  return true;
  410|     97|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  130|  4.27M|        : num_remaining_points(num_remaining_points_),
  131|  4.27M|          last_axis(last_axis_),
  132|  4.27M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  123|  2.16M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  2.16M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  2.16M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  114|     38|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    381|      : bit_length_(0),
   87|    381|        num_points_(0),
   88|    381|        num_decoded_points_(0),
   89|    381|        dimension_(dimension),
   90|    381|        p_(dimension, 0),
   91|    381|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    211|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    211|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 8, False: 203]
  ------------------
  197|      8|    return false;
  198|      8|  }
  199|    203|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 17, False: 186]
  ------------------
  200|     17|    return false;
  201|     17|  }
  202|    186|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 4, False: 182]
  ------------------
  203|      4|    return false;
  204|      4|  }
  205|    182|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 30, False: 152]
  ------------------
  206|     30|    return true;
  207|     30|  }
  208|    152|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 20, False: 132]
  ------------------
  209|     20|    return false;
  210|     20|  }
  211|    132|  num_decoded_points_ = 0;
  212|       |
  213|    132|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 6, False: 126]
  ------------------
  214|      6|    return false;
  215|      6|  }
  216|    126|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 11, False: 115]
  ------------------
  217|     11|    return false;
  218|     11|  }
  219|    115|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 9, False: 106]
  ------------------
  220|      9|    return false;
  221|      9|  }
  222|    106|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 105]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|    105|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 96, False: 9]
  ------------------
  227|     96|    return false;
  228|     96|  }
  229|       |
  230|      9|  numbers_decoder_.EndDecoding();
  231|      9|  remaining_bits_decoder_.EndDecoding();
  232|      9|  axis_decoder_.EndDecoding();
  233|      9|  half_decoder_.EndDecoding();
  234|       |
  235|      9|  return true;
  236|    105|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|    105|    uint32_t num_points, OutputIteratorT& oit) {
  264|    105|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|    105|  base_.assign(dimension_, 0);
  278|    105|  levels_.assign(dimension_, 0);
  279|    105|  undo_.clear();
  280|    105|  uint32_t depth = 0;
  281|    105|  DecodingStatus init_status(num_points, 0, 0);
  282|    105|  std::stack<Status> status_stack;
  283|    105|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  28.9k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 28.9k, False: 9]
  ------------------
  287|  28.9k|    const DecodingStatus status = status_stack.top();
  288|  28.9k|    status_stack.pop();
  289|       |
  290|  28.9k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  28.9k|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  28.9k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 19.2k, False: 9.72k]
  ------------------
  295|  19.2k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 19.2k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  45.3k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 45.3k, False: 0]
  ------------------
  299|  45.3k|        const SplitUndo& split = undo_.back();
  300|  45.3k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 45.3k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  45.3k|        base_[split.axis] = split.old_base;
  304|  45.3k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 19.2k, False: 26.0k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  19.2k|          break;
  307|  19.2k|        }
  308|  26.0k|        levels_[split.axis] = split.old_level;
  309|  26.0k|        undo_.pop_back();
  310|  26.0k|      }
  311|  19.2k|      depth = status.depth;
  312|  19.2k|    }
  313|  28.9k|    const VectorUint32& old_base = base_;
  314|  28.9k|    const VectorUint32& levels = levels_;
  315|       |
  316|  28.9k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 28.9k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  28.9k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  28.9k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 28.9k]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  28.9k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  28.9k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 1.74k, False: 27.2k]
  ------------------
  329|  21.0M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 21.0M, False: 1.74k]
  ------------------
  330|  21.0M|        *oit = old_base;
  331|  21.0M|        ++oit;
  332|  21.0M|        ++num_decoded_points_;
  333|  21.0M|      }
  334|  1.74k|      continue;
  335|  1.74k|    }
  336|       |
  337|  27.2k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  27.2k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 432, False: 26.8k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    432|      axes_[0] = axis;
  344|  2.83k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 2.40k, False: 432]
  ------------------
  345|  2.40k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.40k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 90, False: 2.31k]
  |  |  ------------------
  ------------------
  346|  2.40k|      }
  347|  1.13k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 721, False: 412]
  ------------------
  348|  4.17k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 3.47k, False: 701]
  ------------------
  349|  3.47k|          p_[axes_[j]] = 0;
  350|  3.47k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  3.47k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 1.19k, False: 2.27k]
  ------------------
  352|  1.19k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 20, False: 1.17k]
  ------------------
  353|  1.19k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     20|              return false;
  355|     20|            }
  356|  1.19k|          }
  357|  3.45k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  3.45k|        }
  359|    701|        *oit = p_;
  360|    701|        ++oit;
  361|    701|        ++num_decoded_points_;
  362|    701|      }
  363|    412|      continue;
  364|    432|    }
  365|       |
  366|  26.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 26.8k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  26.8k|    const int num_remaining_bits = bit_length_ - level;
  371|  26.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  26.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  26.8k|    uint32_t number = 0;
  376|  26.8k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  26.8k|    uint32_t first_half = num_remaining_points / 2;
  379|  26.8k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 76, False: 26.7k]
  ------------------
  380|       |      // Invalid |number|.
  381|     76|      return false;
  382|     76|    }
  383|  26.7k|    first_half -= number;
  384|  26.7k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  26.7k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 25.4k, False: 1.31k]
  ------------------
  387|  25.4k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 17.8k, False: 7.57k]
  ------------------
  388|  17.8k|        std::swap(first_half, second_half);
  389|  17.8k|      }
  390|  25.4k|    }
  391|       |
  392|  26.7k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 26.7k]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  26.7k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  26.7k|    levels_[axis] += 1;
  400|  26.7k|    base_[axis] += modifier;
  401|  26.7k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 19.6k, False: 7.03k]
  ------------------
  402|  19.6k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  19.6k|    }
  404|  26.7k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 9.62k, False: 17.1k]
  ------------------
  405|  9.62k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  9.62k|    }
  407|  26.7k|    ++depth;
  408|  26.7k|  }
  409|      9|  return true;
  410|    105|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  130|  4.25M|        : num_remaining_points(num_remaining_points_),
  131|  4.25M|          last_axis(last_axis_),
  132|  4.25M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  4.24M|    uint32_t last_axis) {
  242|  4.24M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 4.24M, Folded]
  ------------------
  243|  4.24M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.24M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.20M, False: 3.03M]
  |  |  ------------------
  ------------------
  244|  4.24M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  4.24M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  123|  2.13M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  2.13M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  2.13M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  114|     39|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    351|      : bit_length_(0),
   87|    351|        num_points_(0),
   88|    351|        num_decoded_points_(0),
   89|    351|        dimension_(dimension),
   90|    351|        p_(dimension, 0),
   91|    351|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    255|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    255|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 6, False: 249]
  ------------------
  197|      6|    return false;
  198|      6|  }
  199|    249|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 36, False: 213]
  ------------------
  200|     36|    return false;
  201|     36|  }
  202|    213|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 5, False: 208]
  ------------------
  203|      5|    return false;
  204|      5|  }
  205|    208|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 27, False: 181]
  ------------------
  206|     27|    return true;
  207|     27|  }
  208|    181|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 42, False: 139]
  ------------------
  209|     42|    return false;
  210|     42|  }
  211|    139|  num_decoded_points_ = 0;
  212|       |
  213|    139|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 9, False: 130]
  ------------------
  214|      9|    return false;
  215|      9|  }
  216|    130|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 4, False: 126]
  ------------------
  217|      4|    return false;
  218|      4|  }
  219|    126|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 1, False: 125]
  ------------------
  220|      1|    return false;
  221|      1|  }
  222|    125|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 124]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|    124|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 65, False: 59]
  ------------------
  227|     65|    return false;
  228|     65|  }
  229|       |
  230|     59|  numbers_decoder_.EndDecoding();
  231|     59|  remaining_bits_decoder_.EndDecoding();
  232|     59|  axis_decoder_.EndDecoding();
  233|     59|  half_decoder_.EndDecoding();
  234|       |
  235|     59|  return true;
  236|    124|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|    124|    uint32_t num_points, OutputIteratorT& oit) {
  264|    124|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|    124|  base_.assign(dimension_, 0);
  278|    124|  levels_.assign(dimension_, 0);
  279|    124|  undo_.clear();
  280|    124|  uint32_t depth = 0;
  281|    124|  DecodingStatus init_status(num_points, 0, 0);
  282|    124|  std::stack<Status> status_stack;
  283|    124|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  2.45M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 2.45M, False: 59]
  ------------------
  287|  2.45M|    const DecodingStatus status = status_stack.top();
  288|  2.45M|    status_stack.pop();
  289|       |
  290|  2.45M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  2.45M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  2.45M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 1.23M, False: 1.21M]
  ------------------
  295|  1.23M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 1.23M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  2.47M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 2.47M, False: 0]
  ------------------
  299|  2.47M|        const SplitUndo& split = undo_.back();
  300|  2.47M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 2.47M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  2.47M|        base_[split.axis] = split.old_base;
  304|  2.47M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 1.23M, False: 1.23M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  1.23M|          break;
  307|  1.23M|        }
  308|  1.23M|        levels_[split.axis] = split.old_level;
  309|  1.23M|        undo_.pop_back();
  310|  1.23M|      }
  311|  1.23M|      depth = status.depth;
  312|  1.23M|    }
  313|  2.45M|    const VectorUint32& old_base = base_;
  314|  2.45M|    const VectorUint32& levels = levels_;
  315|       |
  316|  2.45M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 2.45M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  2.45M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  2.45M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 2.45M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  2.45M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  2.45M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 1.12M, False: 1.33M]
  ------------------
  329|  91.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 90.7M, False: 1.12M]
  ------------------
  330|  90.7M|        *oit = old_base;
  331|  90.7M|        ++oit;
  332|  90.7M|        ++num_decoded_points_;
  333|  90.7M|      }
  334|  1.12M|      continue;
  335|  1.12M|    }
  336|       |
  337|  1.33M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  1.33M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 85.6k, False: 1.25M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|  85.6k|      axes_[0] = axis;
  344|   132k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 46.9k, False: 85.6k]
  ------------------
  345|  46.9k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  46.9k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 14.8k, False: 32.1k]
  |  |  ------------------
  ------------------
  346|  46.9k|      }
  347|   219k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 134k, False: 85.6k]
  ------------------
  348|   332k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 197k, False: 134k]
  ------------------
  349|   197k|          p_[axes_[j]] = 0;
  350|   197k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|   197k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 171k, False: 26.0k]
  ------------------
  352|   171k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 58, False: 171k]
  ------------------
  353|   171k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     58|              return false;
  355|     58|            }
  356|   171k|          }
  357|   197k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|   197k|        }
  359|   134k|        *oit = p_;
  360|   134k|        ++oit;
  361|   134k|        ++num_decoded_points_;
  362|   134k|      }
  363|  85.6k|      continue;
  364|  85.6k|    }
  365|       |
  366|  1.25M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1.25M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  1.25M|    const int num_remaining_bits = bit_length_ - level;
  371|  1.25M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  1.25M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  1.25M|    uint32_t number = 0;
  376|  1.25M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  1.25M|    uint32_t first_half = num_remaining_points / 2;
  379|  1.25M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 7, False: 1.25M]
  ------------------
  380|       |      // Invalid |number|.
  381|      7|      return false;
  382|      7|    }
  383|  1.25M|    first_half -= number;
  384|  1.25M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  1.25M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.18M, False: 66.2k]
  ------------------
  387|  1.18M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.14M, False: 41.5k]
  ------------------
  388|  1.14M|        std::swap(first_half, second_half);
  389|  1.14M|      }
  390|  1.18M|    }
  391|       |
  392|  1.25M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 1.25M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  1.25M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  1.25M|    levels_[axis] += 1;
  400|  1.25M|    base_[axis] += modifier;
  401|  1.25M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 1.24M, False: 10.8k]
  ------------------
  402|  1.24M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  1.24M|    }
  404|  1.25M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 1.21M, False: 32.0k]
  ------------------
  405|  1.21M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  1.21M|    }
  407|  1.25M|    ++depth;
  408|  1.25M|  }
  409|     59|  return true;
  410|    124|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  130|  2.45M|        : num_remaining_points(num_remaining_points_),
  131|  2.45M|          last_axis(last_axis_),
  132|  2.45M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  123|  1.25M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  1.25M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  1.25M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  114|     86|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    292|      : bit_length_(0),
   87|    292|        num_points_(0),
   88|    292|        num_decoded_points_(0),
   89|    292|        dimension_(dimension),
   90|    292|        p_(dimension, 0),
   91|    292|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    258|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    258|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 4, False: 254]
  ------------------
  197|      4|    return false;
  198|      4|  }
  199|    254|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 48, False: 206]
  ------------------
  200|     48|    return false;
  201|     48|  }
  202|    206|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 2, False: 204]
  ------------------
  203|      2|    return false;
  204|      2|  }
  205|    204|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 6, False: 198]
  ------------------
  206|      6|    return true;
  207|      6|  }
  208|    198|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 18, False: 180]
  ------------------
  209|     18|    return false;
  210|     18|  }
  211|    180|  num_decoded_points_ = 0;
  212|       |
  213|    180|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 24, False: 156]
  ------------------
  214|     24|    return false;
  215|     24|  }
  216|    156|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 2, False: 154]
  ------------------
  217|      2|    return false;
  218|      2|  }
  219|    154|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 4, False: 150]
  ------------------
  220|      4|    return false;
  221|      4|  }
  222|    150|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 4, False: 146]
  ------------------
  223|      4|    return false;
  224|      4|  }
  225|       |
  226|    146|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 101, False: 45]
  ------------------
  227|    101|    return false;
  228|    101|  }
  229|       |
  230|     45|  numbers_decoder_.EndDecoding();
  231|     45|  remaining_bits_decoder_.EndDecoding();
  232|     45|  axis_decoder_.EndDecoding();
  233|     45|  half_decoder_.EndDecoding();
  234|       |
  235|     45|  return true;
  236|    146|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|    146|    uint32_t num_points, OutputIteratorT& oit) {
  264|    146|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|    146|  base_.assign(dimension_, 0);
  278|    146|  levels_.assign(dimension_, 0);
  279|    146|  undo_.clear();
  280|    146|  uint32_t depth = 0;
  281|    146|  DecodingStatus init_status(num_points, 0, 0);
  282|    146|  std::stack<Status> status_stack;
  283|    146|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  3.28M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 3.28M, False: 45]
  ------------------
  287|  3.28M|    const DecodingStatus status = status_stack.top();
  288|  3.28M|    status_stack.pop();
  289|       |
  290|  3.28M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  3.28M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  3.28M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 1.70M, False: 1.58M]
  ------------------
  295|  1.70M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 1.70M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  3.38M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 3.38M, False: 0]
  ------------------
  299|  3.38M|        const SplitUndo& split = undo_.back();
  300|  3.38M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 3.38M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  3.38M|        base_[split.axis] = split.old_base;
  304|  3.38M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 1.70M, False: 1.68M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  1.70M|          break;
  307|  1.70M|        }
  308|  1.68M|        levels_[split.axis] = split.old_level;
  309|  1.68M|        undo_.pop_back();
  310|  1.68M|      }
  311|  1.70M|      depth = status.depth;
  312|  1.70M|    }
  313|  3.28M|    const VectorUint32& old_base = base_;
  314|  3.28M|    const VectorUint32& levels = levels_;
  315|       |
  316|  3.28M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 3.28M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  3.28M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  3.28M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 3.28M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  3.28M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  3.28M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 1.43M, False: 1.85M]
  ------------------
  329|   185M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 184M, False: 1.43M]
  ------------------
  330|   184M|        *oit = old_base;
  331|   184M|        ++oit;
  332|   184M|        ++num_decoded_points_;
  333|   184M|      }
  334|  1.43M|      continue;
  335|  1.43M|    }
  336|       |
  337|  1.85M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  1.85M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 107k, False: 1.74M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|   107k|      axes_[0] = axis;
  344|   251k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 144k, False: 107k]
  ------------------
  345|   144k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   144k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 16.2k, False: 128k]
  |  |  ------------------
  ------------------
  346|   144k|      }
  347|   256k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 149k, False: 107k]
  ------------------
  348|   540k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 390k, False: 149k]
  ------------------
  349|   390k|          p_[axes_[j]] = 0;
  350|   390k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|   390k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 191k, False: 198k]
  ------------------
  352|   191k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 93, False: 191k]
  ------------------
  353|   191k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     93|              return false;
  355|     93|            }
  356|   191k|          }
  357|   390k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|   390k|        }
  359|   149k|        *oit = p_;
  360|   149k|        ++oit;
  361|   149k|        ++num_decoded_points_;
  362|   149k|      }
  363|   107k|      continue;
  364|   107k|    }
  365|       |
  366|  1.74M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1.74M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  1.74M|    const int num_remaining_bits = bit_length_ - level;
  371|  1.74M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  1.74M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  1.74M|    uint32_t number = 0;
  376|  1.74M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  1.74M|    uint32_t first_half = num_remaining_points / 2;
  379|  1.74M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 8, False: 1.74M]
  ------------------
  380|       |      // Invalid |number|.
  381|      8|      return false;
  382|      8|    }
  383|  1.74M|    first_half -= number;
  384|  1.74M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  1.74M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.72M, False: 21.4k]
  ------------------
  387|  1.72M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.64M, False: 75.3k]
  ------------------
  388|  1.64M|        std::swap(first_half, second_half);
  389|  1.64M|      }
  390|  1.72M|    }
  391|       |
  392|  1.74M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 1.74M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  1.74M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  1.74M|    levels_[axis] += 1;
  400|  1.74M|    base_[axis] += modifier;
  401|  1.74M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 1.70M, False: 37.0k]
  ------------------
  402|  1.70M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  1.70M|    }
  404|  1.74M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 1.58M, False: 162k]
  ------------------
  405|  1.58M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  1.58M|    }
  407|  1.74M|    ++depth;
  408|  1.74M|  }
  409|     45|  return true;
  410|    146|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  130|  3.28M|        : num_remaining_points(num_remaining_points_),
  131|  3.28M|          last_axis(last_axis_),
  132|  3.28M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  3.28M|    uint32_t last_axis) {
  242|  3.28M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 3.28M, Folded]
  ------------------
  243|  3.28M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.28M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.62M, False: 1.66M]
  |  |  ------------------
  ------------------
  244|  3.28M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  3.28M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  123|  1.74M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  1.74M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  1.74M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  114|     51|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    407|      : bit_length_(0),
   87|    407|        num_points_(0),
   88|    407|        num_decoded_points_(0),
   89|    407|        dimension_(dimension),
   90|    407|        p_(dimension, 0),
   91|    407|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    319|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    319|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 3, False: 316]
  ------------------
  197|      3|    return false;
  198|      3|  }
  199|    316|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 38, False: 278]
  ------------------
  200|     38|    return false;
  201|     38|  }
  202|    278|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 3, False: 275]
  ------------------
  203|      3|    return false;
  204|      3|  }
  205|    275|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 69, False: 206]
  ------------------
  206|     69|    return true;
  207|     69|  }
  208|    206|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 73, False: 133]
  ------------------
  209|     73|    return false;
  210|     73|  }
  211|    133|  num_decoded_points_ = 0;
  212|       |
  213|    133|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 50, False: 83]
  ------------------
  214|     50|    return false;
  215|     50|  }
  216|     83|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 2, False: 81]
  ------------------
  217|      2|    return false;
  218|      2|  }
  219|     81|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 4, False: 77]
  ------------------
  220|      4|    return false;
  221|      4|  }
  222|     77|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 75]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     75|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 54, False: 21]
  ------------------
  227|     54|    return false;
  228|     54|  }
  229|       |
  230|     21|  numbers_decoder_.EndDecoding();
  231|     21|  remaining_bits_decoder_.EndDecoding();
  232|     21|  axis_decoder_.EndDecoding();
  233|     21|  half_decoder_.EndDecoding();
  234|       |
  235|     21|  return true;
  236|     75|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     75|    uint32_t num_points, OutputIteratorT& oit) {
  264|     75|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     75|  base_.assign(dimension_, 0);
  278|     75|  levels_.assign(dimension_, 0);
  279|     75|  undo_.clear();
  280|     75|  uint32_t depth = 0;
  281|     75|  DecodingStatus init_status(num_points, 0, 0);
  282|     75|  std::stack<Status> status_stack;
  283|     75|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|   121k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 121k, False: 21]
  ------------------
  287|   121k|    const DecodingStatus status = status_stack.top();
  288|   121k|    status_stack.pop();
  289|       |
  290|   121k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|   121k|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|   121k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 107k, False: 13.8k]
  ------------------
  295|   107k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 107k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|   189k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 189k, False: 0]
  ------------------
  299|   189k|        const SplitUndo& split = undo_.back();
  300|   189k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 189k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|   189k|        base_[split.axis] = split.old_base;
  304|   189k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 107k, False: 82.7k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|   107k|          break;
  307|   107k|        }
  308|  82.7k|        levels_[split.axis] = split.old_level;
  309|  82.7k|        undo_.pop_back();
  310|  82.7k|      }
  311|   107k|      depth = status.depth;
  312|   107k|    }
  313|   121k|    const VectorUint32& old_base = base_;
  314|   121k|    const VectorUint32& levels = levels_;
  315|       |
  316|   121k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 121k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|   121k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|   121k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 8, False: 120k]
  ------------------
  322|      8|      return false;
  323|      8|    }
  324|       |
  325|   120k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|   120k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 289, False: 120k]
  ------------------
  329|  18.6M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 18.6M, False: 289]
  ------------------
  330|  18.6M|        *oit = old_base;
  331|  18.6M|        ++oit;
  332|  18.6M|        ++num_decoded_points_;
  333|  18.6M|      }
  334|    289|      continue;
  335|    289|    }
  336|       |
  337|   120k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|   120k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 299, False: 120k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    299|      axes_[0] = axis;
  344|  19.6k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 19.3k, False: 299]
  ------------------
  345|  19.3k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  19.3k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 289, False: 19.0k]
  |  |  ------------------
  ------------------
  346|  19.3k|      }
  347|    675|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 409, False: 266]
  ------------------
  348|  23.8k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 23.4k, False: 376]
  ------------------
  349|  23.4k|          p_[axes_[j]] = 0;
  350|  23.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  23.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 23.1k, False: 317]
  ------------------
  352|  23.1k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 33, False: 23.1k]
  ------------------
  353|  23.1k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     33|              return false;
  355|     33|            }
  356|  23.1k|          }
  357|  23.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  23.4k|        }
  359|    376|        *oit = p_;
  360|    376|        ++oit;
  361|    376|        ++num_decoded_points_;
  362|    376|      }
  363|    266|      continue;
  364|    299|    }
  365|       |
  366|   120k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 120k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|   120k|    const int num_remaining_bits = bit_length_ - level;
  371|   120k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|   120k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|   120k|    uint32_t number = 0;
  376|   120k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|   120k|    uint32_t first_half = num_remaining_points / 2;
  379|   120k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 13, False: 120k]
  ------------------
  380|       |      // Invalid |number|.
  381|     13|      return false;
  382|     13|    }
  383|   120k|    first_half -= number;
  384|   120k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|   120k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 120k, False: 11]
  ------------------
  387|   120k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 107k, False: 13.3k]
  ------------------
  388|   107k|        std::swap(first_half, second_half);
  389|   107k|      }
  390|   120k|    }
  391|       |
  392|   120k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 120k]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|   120k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|   120k|    levels_[axis] += 1;
  400|   120k|    base_[axis] += modifier;
  401|   120k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 107k, False: 12.9k]
  ------------------
  402|   107k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|   107k|    }
  404|   120k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 13.7k, False: 106k]
  ------------------
  405|  13.7k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  13.7k|    }
  407|   120k|    ++depth;
  408|   120k|  }
  409|     21|  return true;
  410|     75|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  130|   121k|        : num_remaining_points(num_remaining_points_),
  131|   121k|          last_axis(last_axis_),
  132|   121k|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  123|   120k|  void DecodeNumber(int nbits, uint32_t* value) {
  124|   120k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|   120k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  114|     90|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  7.27M|    uint32_t last_axis) {
  242|  7.27M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 7.27M, Folded]
  ------------------
  243|  7.27M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  7.27M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 6.57M, False: 701k]
  |  |  ------------------
  ------------------
  244|  7.27M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  7.27M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  4.27M|    uint32_t last_axis) {
  242|  4.27M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 4.27M, Folded]
  ------------------
  243|  4.27M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.27M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.20M, False: 3.06M]
  |  |  ------------------
  ------------------
  244|  4.27M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  4.27M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  2.45M|    uint32_t last_axis) {
  242|  2.45M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 2.45M, Folded]
  ------------------
  243|  2.45M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.45M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.27M, False: 187k]
  |  |  ------------------
  ------------------
  244|  2.45M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  2.45M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|   121k|    uint32_t last_axis) {
  242|   121k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [Folded, False: 121k]
  ------------------
  243|      0|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|      0|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  244|      0|  }
  245|       |
  246|   121k|  uint32_t best_axis = 0;
  247|   121k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 120k, False: 666]
  ------------------
  248|  16.4M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 16.3M, False: 120k]
  ------------------
  249|  16.3M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 119k, False: 16.2M]
  ------------------
  250|   119k|        best_axis = axis;
  251|   119k|      }
  252|  16.3M|    }
  253|   120k|  } else {
  254|    666|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|    666|  }
  256|       |
  257|   121k|  return best_axis;
  258|   121k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    175|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    175|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    175|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    175|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    175|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 4, False: 171]
  ------------------
  197|      4|    return false;
  198|      4|  }
  199|    171|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 30, False: 141]
  ------------------
  200|     30|    return false;
  201|     30|  }
  202|    141|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 2, False: 139]
  ------------------
  203|      2|    return false;
  204|      2|  }
  205|    139|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 2, False: 137]
  ------------------
  206|      2|    return true;
  207|      2|  }
  208|    137|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 137]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|    137|  num_decoded_points_ = 0;
  212|       |
  213|    137|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 55, False: 82]
  ------------------
  214|     55|    return false;
  215|     55|  }
  216|     82|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 12, False: 70]
  ------------------
  217|     12|    return false;
  218|     12|  }
  219|     70|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 1, False: 69]
  ------------------
  220|      1|    return false;
  221|      1|  }
  222|     69|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 68]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|     68|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 50, False: 18]
  ------------------
  227|     50|    return false;
  228|     50|  }
  229|       |
  230|     18|  numbers_decoder_.EndDecoding();
  231|     18|  remaining_bits_decoder_.EndDecoding();
  232|     18|  axis_decoder_.EndDecoding();
  233|     18|  half_decoder_.EndDecoding();
  234|       |
  235|     18|  return true;
  236|     68|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     68|    uint32_t num_points, OutputIteratorT& oit) {
  264|     68|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     68|  base_.assign(dimension_, 0);
  278|     68|  levels_.assign(dimension_, 0);
  279|     68|  undo_.clear();
  280|     68|  uint32_t depth = 0;
  281|     68|  DecodingStatus init_status(num_points, 0, 0);
  282|     68|  std::stack<Status> status_stack;
  283|     68|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|   955k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 955k, False: 18]
  ------------------
  287|   955k|    const DecodingStatus status = status_stack.top();
  288|   955k|    status_stack.pop();
  289|       |
  290|   955k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|   955k|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|   955k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 477k, False: 478k]
  ------------------
  295|   477k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 477k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|   955k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 955k, False: 0]
  ------------------
  299|   955k|        const SplitUndo& split = undo_.back();
  300|   955k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 955k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|   955k|        base_[split.axis] = split.old_base;
  304|   955k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 477k, False: 477k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|   477k|          break;
  307|   477k|        }
  308|   477k|        levels_[split.axis] = split.old_level;
  309|   477k|        undo_.pop_back();
  310|   477k|      }
  311|   477k|      depth = status.depth;
  312|   477k|    }
  313|   955k|    const VectorUint32& old_base = base_;
  314|   955k|    const VectorUint32& levels = levels_;
  315|       |
  316|   955k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 955k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|   955k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|   955k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 955k]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|   955k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|   955k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 476k, False: 479k]
  ------------------
  329|   154M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 154M, False: 476k]
  ------------------
  330|   154M|        *oit = old_base;
  331|   154M|        ++oit;
  332|   154M|        ++num_decoded_points_;
  333|   154M|      }
  334|   476k|      continue;
  335|   476k|    }
  336|       |
  337|   479k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|   479k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 969, False: 478k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    969|      axes_[0] = axis;
  344|  2.90k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 1.93k, False: 969]
  ------------------
  345|  1.93k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.93k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 222, False: 1.71k]
  |  |  ------------------
  ------------------
  346|  1.93k|      }
  347|  2.58k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.64k, False: 938]
  ------------------
  348|  6.51k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 4.89k, False: 1.61k]
  ------------------
  349|  4.89k|          p_[axes_[j]] = 0;
  350|  4.89k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  4.89k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 2.26k, False: 2.63k]
  ------------------
  352|  2.26k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 31, False: 2.23k]
  ------------------
  353|  2.26k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     31|              return false;
  355|     31|            }
  356|  2.26k|          }
  357|  4.86k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  4.86k|        }
  359|  1.61k|        *oit = p_;
  360|  1.61k|        ++oit;
  361|  1.61k|        ++num_decoded_points_;
  362|  1.61k|      }
  363|    938|      continue;
  364|    969|    }
  365|       |
  366|   478k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 478k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|   478k|    const int num_remaining_bits = bit_length_ - level;
  371|   478k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|   478k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|   478k|    uint32_t number = 0;
  376|   478k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|   478k|    uint32_t first_half = num_remaining_points / 2;
  379|   478k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 19, False: 478k]
  ------------------
  380|       |      // Invalid |number|.
  381|     19|      return false;
  382|     19|    }
  383|   478k|    first_half -= number;
  384|   478k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|   478k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 205k, False: 272k]
  ------------------
  387|   205k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 204k, False: 1.06k]
  ------------------
  388|   204k|        std::swap(first_half, second_half);
  389|   204k|      }
  390|   205k|    }
  391|       |
  392|   478k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 478k]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|   478k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|   478k|    levels_[axis] += 1;
  400|   478k|    base_[axis] += modifier;
  401|   478k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 478k, False: 51]
  ------------------
  402|   478k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|   478k|    }
  404|   478k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 478k, False: 96]
  ------------------
  405|   478k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|   478k|    }
  407|   478k|    ++depth;
  408|   478k|  }
  409|     18|  return true;
  410|     68|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    160|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    160|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    160|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    160|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    160|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 3, False: 157]
  ------------------
  197|      3|    return false;
  198|      3|  }
  199|    157|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 33, False: 124]
  ------------------
  200|     33|    return false;
  201|     33|  }
  202|    124|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 2, False: 122]
  ------------------
  203|      2|    return false;
  204|      2|  }
  205|    122|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 5, False: 117]
  ------------------
  206|      5|    return true;
  207|      5|  }
  208|    117|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 117]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|    117|  num_decoded_points_ = 0;
  212|       |
  213|    117|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 27, False: 90]
  ------------------
  214|     27|    return false;
  215|     27|  }
  216|     90|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 5, False: 85]
  ------------------
  217|      5|    return false;
  218|      5|  }
  219|     85|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 3, False: 82]
  ------------------
  220|      3|    return false;
  221|      3|  }
  222|     82|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 3, False: 79]
  ------------------
  223|      3|    return false;
  224|      3|  }
  225|       |
  226|     79|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 58, False: 21]
  ------------------
  227|     58|    return false;
  228|     58|  }
  229|       |
  230|     21|  numbers_decoder_.EndDecoding();
  231|     21|  remaining_bits_decoder_.EndDecoding();
  232|     21|  axis_decoder_.EndDecoding();
  233|     21|  half_decoder_.EndDecoding();
  234|       |
  235|     21|  return true;
  236|     79|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     79|    uint32_t num_points, OutputIteratorT& oit) {
  264|     79|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     79|  base_.assign(dimension_, 0);
  278|     79|  levels_.assign(dimension_, 0);
  279|     79|  undo_.clear();
  280|     79|  uint32_t depth = 0;
  281|     79|  DecodingStatus init_status(num_points, 0, 0);
  282|     79|  std::stack<Status> status_stack;
  283|     79|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  1.95M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 1.95M, False: 21]
  ------------------
  287|  1.95M|    const DecodingStatus status = status_stack.top();
  288|  1.95M|    status_stack.pop();
  289|       |
  290|  1.95M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  1.95M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  1.95M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 975k, False: 975k]
  ------------------
  295|   975k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 975k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  1.95M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 1.95M, False: 0]
  ------------------
  299|  1.95M|        const SplitUndo& split = undo_.back();
  300|  1.95M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 1.95M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  1.95M|        base_[split.axis] = split.old_base;
  304|  1.95M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 975k, False: 975k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|   975k|          break;
  307|   975k|        }
  308|   975k|        levels_[split.axis] = split.old_level;
  309|   975k|        undo_.pop_back();
  310|   975k|      }
  311|   975k|      depth = status.depth;
  312|   975k|    }
  313|  1.95M|    const VectorUint32& old_base = base_;
  314|  1.95M|    const VectorUint32& levels = levels_;
  315|       |
  316|  1.95M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 1.95M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  1.95M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  1.95M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 1.95M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  1.95M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  1.95M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 974k, False: 977k]
  ------------------
  329|  94.6M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 93.6M, False: 974k]
  ------------------
  330|  93.6M|        *oit = old_base;
  331|  93.6M|        ++oit;
  332|  93.6M|        ++num_decoded_points_;
  333|  93.6M|      }
  334|   974k|      continue;
  335|   974k|    }
  336|       |
  337|   977k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|   977k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 1.12k, False: 975k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|  1.12k|      axes_[0] = axis;
  344|  3.37k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 2.25k, False: 1.12k]
  ------------------
  345|  2.25k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.25k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 402, False: 1.85k]
  |  |  ------------------
  ------------------
  346|  2.25k|      }
  347|  2.92k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.83k, False: 1.08k]
  ------------------
  348|  7.25k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 5.45k, False: 1.79k]
  ------------------
  349|  5.45k|          p_[axes_[j]] = 0;
  350|  5.45k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  5.45k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 3.06k, False: 2.38k]
  ------------------
  352|  3.06k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 42, False: 3.02k]
  ------------------
  353|  3.06k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     42|              return false;
  355|     42|            }
  356|  3.06k|          }
  357|  5.41k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  5.41k|        }
  359|  1.79k|        *oit = p_;
  360|  1.79k|        ++oit;
  361|  1.79k|        ++num_decoded_points_;
  362|  1.79k|      }
  363|  1.08k|      continue;
  364|  1.12k|    }
  365|       |
  366|   975k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 975k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|   975k|    const int num_remaining_bits = bit_length_ - level;
  371|   975k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|   975k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|   975k|    uint32_t number = 0;
  376|   975k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|   975k|    uint32_t first_half = num_remaining_points / 2;
  379|   975k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 16, False: 975k]
  ------------------
  380|       |      // Invalid |number|.
  381|     16|      return false;
  382|     16|    }
  383|   975k|    first_half -= number;
  384|   975k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|   975k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 517k, False: 458k]
  ------------------
  387|   517k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 516k, False: 713]
  ------------------
  388|   516k|        std::swap(first_half, second_half);
  389|   516k|      }
  390|   517k|    }
  391|       |
  392|   975k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 975k]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|   975k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|   975k|    levels_[axis] += 1;
  400|   975k|    base_[axis] += modifier;
  401|   975k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 975k, False: 34]
  ------------------
  402|   975k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|   975k|    }
  404|   975k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 975k, False: 89]
  ------------------
  405|   975k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|   975k|    }
  407|   975k|    ++depth;
  408|   975k|  }
  409|     21|  return true;
  410|     79|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    152|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    152|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    152|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    152|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    152|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 2, False: 150]
  ------------------
  197|      2|    return false;
  198|      2|  }
  199|    150|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 26, False: 124]
  ------------------
  200|     26|    return false;
  201|     26|  }
  202|    124|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 123]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|    123|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 122]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|    122|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 122]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|    122|  num_decoded_points_ = 0;
  212|       |
  213|    122|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 36, False: 86]
  ------------------
  214|     36|    return false;
  215|     36|  }
  216|     86|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 10, False: 76]
  ------------------
  217|     10|    return false;
  218|     10|  }
  219|     76|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 2, False: 74]
  ------------------
  220|      2|    return false;
  221|      2|  }
  222|     74|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 72]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     72|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 68, False: 4]
  ------------------
  227|     68|    return false;
  228|     68|  }
  229|       |
  230|      4|  numbers_decoder_.EndDecoding();
  231|      4|  remaining_bits_decoder_.EndDecoding();
  232|      4|  axis_decoder_.EndDecoding();
  233|      4|  half_decoder_.EndDecoding();
  234|       |
  235|      4|  return true;
  236|     72|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     72|    uint32_t num_points, OutputIteratorT& oit) {
  264|     72|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     72|  base_.assign(dimension_, 0);
  278|     72|  levels_.assign(dimension_, 0);
  279|     72|  undo_.clear();
  280|     72|  uint32_t depth = 0;
  281|     72|  DecodingStatus init_status(num_points, 0, 0);
  282|     72|  std::stack<Status> status_stack;
  283|     72|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  4.21M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 4.21M, False: 4]
  ------------------
  287|  4.21M|    const DecodingStatus status = status_stack.top();
  288|  4.21M|    status_stack.pop();
  289|       |
  290|  4.21M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  4.21M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  4.21M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 2.10M, False: 2.11M]
  ------------------
  295|  2.10M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 2.10M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  4.21M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 4.21M, False: 0]
  ------------------
  299|  4.21M|        const SplitUndo& split = undo_.back();
  300|  4.21M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 4.21M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  4.21M|        base_[split.axis] = split.old_base;
  304|  4.21M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 2.10M, False: 2.10M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  2.10M|          break;
  307|  2.10M|        }
  308|  2.10M|        levels_[split.axis] = split.old_level;
  309|  2.10M|        undo_.pop_back();
  310|  2.10M|      }
  311|  2.10M|      depth = status.depth;
  312|  2.10M|    }
  313|  4.21M|    const VectorUint32& old_base = base_;
  314|  4.21M|    const VectorUint32& levels = levels_;
  315|       |
  316|  4.21M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 4.21M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  4.21M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  4.21M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 4.21M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  4.21M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  4.21M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 2.10M, False: 2.11M]
  ------------------
  329|  17.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 15.0M, False: 2.10M]
  ------------------
  330|  15.0M|        *oit = old_base;
  331|  15.0M|        ++oit;
  332|  15.0M|        ++num_decoded_points_;
  333|  15.0M|      }
  334|  2.10M|      continue;
  335|  2.10M|    }
  336|       |
  337|  2.11M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  2.11M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 505, False: 2.11M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    505|      axes_[0] = axis;
  344|  1.51k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 1.01k, False: 505]
  ------------------
  345|  1.01k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.01k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 238, False: 772]
  |  |  ------------------
  ------------------
  346|  1.01k|      }
  347|  1.35k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 860, False: 490]
  ------------------
  348|  3.40k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 2.56k, False: 845]
  ------------------
  349|  2.56k|          p_[axes_[j]] = 0;
  350|  2.56k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  2.56k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 1.55k, False: 1.00k]
  ------------------
  352|  1.55k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 15, False: 1.54k]
  ------------------
  353|  1.55k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     15|              return false;
  355|     15|            }
  356|  1.55k|          }
  357|  2.54k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  2.54k|        }
  359|    845|        *oit = p_;
  360|    845|        ++oit;
  361|    845|        ++num_decoded_points_;
  362|    845|      }
  363|    490|      continue;
  364|    505|    }
  365|       |
  366|  2.11M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 2.11M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  2.11M|    const int num_remaining_bits = bit_length_ - level;
  371|  2.11M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  2.11M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  2.11M|    uint32_t number = 0;
  376|  2.11M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  2.11M|    uint32_t first_half = num_remaining_points / 2;
  379|  2.11M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 53, False: 2.11M]
  ------------------
  380|       |      // Invalid |number|.
  381|     53|      return false;
  382|     53|    }
  383|  2.11M|    first_half -= number;
  384|  2.11M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  2.11M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.05M, False: 1.05M]
  ------------------
  387|  1.05M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.05M, False: 1.63k]
  ------------------
  388|  1.05M|        std::swap(first_half, second_half);
  389|  1.05M|      }
  390|  1.05M|    }
  391|       |
  392|  2.11M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 2.11M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  2.11M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  2.11M|    levels_[axis] += 1;
  400|  2.11M|    base_[axis] += modifier;
  401|  2.11M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 2.11M, False: 92]
  ------------------
  402|  2.11M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  2.11M|    }
  404|  2.11M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 2.11M, False: 129]
  ------------------
  405|  2.11M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  2.11M|    }
  407|  2.11M|    ++depth;
  408|  2.11M|  }
  409|      4|  return true;
  410|     72|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    170|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    170|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    170|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    170|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    170|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 1, False: 169]
  ------------------
  197|      1|    return false;
  198|      1|  }
  199|    169|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 5, False: 164]
  ------------------
  200|      5|    return false;
  201|      5|  }
  202|    164|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 2, False: 162]
  ------------------
  203|      2|    return false;
  204|      2|  }
  205|    162|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 161]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|    161|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 161]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|    161|  num_decoded_points_ = 0;
  212|       |
  213|    161|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 60, False: 101]
  ------------------
  214|     60|    return false;
  215|     60|  }
  216|    101|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 15, False: 86]
  ------------------
  217|     15|    return false;
  218|     15|  }
  219|     86|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 5, False: 81]
  ------------------
  220|      5|    return false;
  221|      5|  }
  222|     81|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 79]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     79|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 73, False: 6]
  ------------------
  227|     73|    return false;
  228|     73|  }
  229|       |
  230|      6|  numbers_decoder_.EndDecoding();
  231|      6|  remaining_bits_decoder_.EndDecoding();
  232|      6|  axis_decoder_.EndDecoding();
  233|      6|  half_decoder_.EndDecoding();
  234|       |
  235|      6|  return true;
  236|     79|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     79|    uint32_t num_points, OutputIteratorT& oit) {
  264|     79|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     79|  base_.assign(dimension_, 0);
  278|     79|  levels_.assign(dimension_, 0);
  279|     79|  undo_.clear();
  280|     79|  uint32_t depth = 0;
  281|     79|  DecodingStatus init_status(num_points, 0, 0);
  282|     79|  std::stack<Status> status_stack;
  283|     79|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  4.22M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 4.22M, False: 6]
  ------------------
  287|  4.22M|    const DecodingStatus status = status_stack.top();
  288|  4.22M|    status_stack.pop();
  289|       |
  290|  4.22M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  4.22M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  4.22M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 2.10M, False: 2.11M]
  ------------------
  295|  2.10M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 2.10M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  4.21M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 4.21M, False: 0]
  ------------------
  299|  4.21M|        const SplitUndo& split = undo_.back();
  300|  4.21M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 4.21M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  4.21M|        base_[split.axis] = split.old_base;
  304|  4.21M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 2.10M, False: 2.10M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  2.10M|          break;
  307|  2.10M|        }
  308|  2.10M|        levels_[split.axis] = split.old_level;
  309|  2.10M|        undo_.pop_back();
  310|  2.10M|      }
  311|  2.10M|      depth = status.depth;
  312|  2.10M|    }
  313|  4.22M|    const VectorUint32& old_base = base_;
  314|  4.22M|    const VectorUint32& levels = levels_;
  315|       |
  316|  4.22M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 4.22M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  4.22M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  4.22M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 4.22M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  4.22M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  4.22M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 2.10M, False: 2.11M]
  ------------------
  329|  17.0M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 14.9M, False: 2.10M]
  ------------------
  330|  14.9M|        *oit = old_base;
  331|  14.9M|        ++oit;
  332|  14.9M|        ++num_decoded_points_;
  333|  14.9M|      }
  334|  2.10M|      continue;
  335|  2.10M|    }
  336|       |
  337|  2.11M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  2.11M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 1.39k, False: 2.11M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|  1.39k|      axes_[0] = axis;
  344|  4.17k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 2.78k, False: 1.39k]
  ------------------
  345|  2.78k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.78k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 704, False: 2.08k]
  |  |  ------------------
  ------------------
  346|  2.78k|      }
  347|  3.79k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 2.42k, False: 1.36k]
  ------------------
  348|  9.63k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 7.23k, False: 2.40k]
  ------------------
  349|  7.23k|          p_[axes_[j]] = 0;
  350|  7.23k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  7.23k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 5.65k, False: 1.58k]
  ------------------
  352|  5.65k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 23, False: 5.63k]
  ------------------
  353|  5.65k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     23|              return false;
  355|     23|            }
  356|  5.65k|          }
  357|  7.21k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  7.21k|        }
  359|  2.40k|        *oit = p_;
  360|  2.40k|        ++oit;
  361|  2.40k|        ++num_decoded_points_;
  362|  2.40k|      }
  363|  1.36k|      continue;
  364|  1.39k|    }
  365|       |
  366|  2.11M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 2.11M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  2.11M|    const int num_remaining_bits = bit_length_ - level;
  371|  2.11M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  2.11M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  2.11M|    uint32_t number = 0;
  376|  2.11M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  2.11M|    uint32_t first_half = num_remaining_points / 2;
  379|  2.11M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 50, False: 2.11M]
  ------------------
  380|       |      // Invalid |number|.
  381|     50|      return false;
  382|     50|    }
  383|  2.11M|    first_half -= number;
  384|  2.11M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  2.11M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 727k, False: 1.38M]
  ------------------
  387|   727k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 726k, False: 1.50k]
  ------------------
  388|   726k|        std::swap(first_half, second_half);
  389|   726k|      }
  390|   727k|    }
  391|       |
  392|  2.11M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 2.11M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  2.11M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  2.11M|    levels_[axis] += 1;
  400|  2.11M|    base_[axis] += modifier;
  401|  2.11M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 2.11M, False: 104]
  ------------------
  402|  2.11M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  2.11M|    }
  404|  2.11M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 2.11M, False: 135]
  ------------------
  405|  2.11M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  2.11M|    }
  407|  2.11M|    ++depth;
  408|  2.11M|  }
  409|      6|  return true;
  410|     79|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|     96|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|     96|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|     96|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|     96|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|     96|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 2, False: 94]
  ------------------
  197|      2|    return false;
  198|      2|  }
  199|     94|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 29, False: 65]
  ------------------
  200|     29|    return false;
  201|     29|  }
  202|     65|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 64]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|     64|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 4, False: 60]
  ------------------
  206|      4|    return true;
  207|      4|  }
  208|     60|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 60]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|     60|  num_decoded_points_ = 0;
  212|       |
  213|     60|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 60, False: 0]
  ------------------
  214|     60|    return false;
  215|     60|  }
  216|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 0, False: 0]
  ------------------
  220|      0|    return false;
  221|      0|  }
  222|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 0, False: 0]
  ------------------
  223|      0|    return false;
  224|      0|  }
  225|       |
  226|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 0, False: 0]
  ------------------
  227|      0|    return false;
  228|      0|  }
  229|       |
  230|      0|  numbers_decoder_.EndDecoding();
  231|      0|  remaining_bits_decoder_.EndDecoding();
  232|      0|  axis_decoder_.EndDecoding();
  233|      0|  half_decoder_.EndDecoding();
  234|       |
  235|      0|  return true;
  236|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|     34|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|     34|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|     34|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|     34|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|     34|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 1, False: 33]
  ------------------
  197|      1|    return false;
  198|      1|  }
  199|     33|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 13, False: 20]
  ------------------
  200|     13|    return false;
  201|     13|  }
  202|     20|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 19]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|     19|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 2, False: 17]
  ------------------
  206|      2|    return true;
  207|      2|  }
  208|     17|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 17]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|     17|  num_decoded_points_ = 0;
  212|       |
  213|     17|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 17, False: 0]
  ------------------
  214|     17|    return false;
  215|     17|  }
  216|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 0, False: 0]
  ------------------
  220|      0|    return false;
  221|      0|  }
  222|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 0, False: 0]
  ------------------
  223|      0|    return false;
  224|      0|  }
  225|       |
  226|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 0, False: 0]
  ------------------
  227|      0|    return false;
  228|      0|  }
  229|       |
  230|      0|  numbers_decoder_.EndDecoding();
  231|      0|  remaining_bits_decoder_.EndDecoding();
  232|      0|  axis_decoder_.EndDecoding();
  233|      0|  half_decoder_.EndDecoding();
  234|       |
  235|      0|  return true;
  236|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|     88|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|     88|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|     88|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|     88|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|     88|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 1, False: 87]
  ------------------
  197|      1|    return false;
  198|      1|  }
  199|     87|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 25, False: 62]
  ------------------
  200|     25|    return false;
  201|     25|  }
  202|     62|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 61]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|     61|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 60]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|     60|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 60]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|     60|  num_decoded_points_ = 0;
  212|       |
  213|     60|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 60, False: 0]
  ------------------
  214|     60|    return false;
  215|     60|  }
  216|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 0, False: 0]
  ------------------
  220|      0|    return false;
  221|      0|  }
  222|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 0, False: 0]
  ------------------
  223|      0|    return false;
  224|      0|  }
  225|       |
  226|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 0, False: 0]
  ------------------
  227|      0|    return false;
  228|      0|  }
  229|       |
  230|      0|  numbers_decoder_.EndDecoding();
  231|      0|  remaining_bits_decoder_.EndDecoding();
  232|      0|  axis_decoder_.EndDecoding();
  233|      0|  half_decoder_.EndDecoding();
  234|       |
  235|      0|  return true;
  236|      0|}

_ZN5draco22FloatPointsTreeDecoderC2Ev:
   65|  1.04k|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|  1.04k|  qinfo_.quantization_bits = 0;
   67|  1.04k|  qinfo_.range = 0;
   68|  1.04k|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    993|    DecoderBuffer* buffer, std::vector<Point3ui>* qpoints) {
   72|    993|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 1, False: 992]
  ------------------
   73|      1|    return false;
   74|      1|  }
   75|    992|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 34, False: 958]
  ------------------
   76|     34|    return false;
   77|     34|  }
   78|    958|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 1, False: 957]
  ------------------
   79|      1|    return false;
   80|      1|  }
   81|    957|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 1, False: 956]
  ------------------
   82|      1|    return false;
   83|      1|  }
   84|    956|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 65, False: 891]
  |  Branch (84:38): [True: 35, False: 30]
  ------------------
   85|     35|    return false;
   86|     35|  }
   87|    921|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 2, False: 919]
  ------------------
   88|      2|    return false;
   89|      2|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    919|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 39, False: 880]
  ------------------
   93|     39|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|     39|#define DRACO_LOGE printf
  ------------------
   94|     39|               compression_level_);
   95|     39|    return false;
   96|     39|  }
   97|       |
   98|    880|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    880|      std::back_inserter(*qpoints);
  100|    880|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    880|                           Converter>
  102|    880|      oit(oit_qpoints);
  103|    880|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 875, False: 5]
  ------------------
  104|    875|    qpoints->reserve(num_points_);
  105|    875|    switch (compression_level_) {
  106|    175|      case 0: {
  ------------------
  |  Branch (106:7): [True: 175, False: 700]
  ------------------
  107|    175|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|    175|        qpoints_decoder.DecodePoints(buffer, oit);
  109|    175|        break;
  110|      0|      }
  111|    160|      case 1: {
  ------------------
  |  Branch (111:7): [True: 160, False: 715]
  ------------------
  112|    160|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|    160|        qpoints_decoder.DecodePoints(buffer, oit);
  114|    160|        break;
  115|      0|      }
  116|    152|      case 2: {
  ------------------
  |  Branch (116:7): [True: 152, False: 723]
  ------------------
  117|    152|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|    152|        qpoints_decoder.DecodePoints(buffer, oit);
  119|    152|        break;
  120|      0|      }
  121|    170|      case 3: {
  ------------------
  |  Branch (121:7): [True: 170, False: 705]
  ------------------
  122|    170|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    170|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    170|        break;
  125|      0|      }
  126|     96|      case 4: {
  ------------------
  |  Branch (126:7): [True: 96, False: 779]
  ------------------
  127|     96|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     96|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     96|        break;
  130|      0|      }
  131|     34|      case 5: {
  ------------------
  |  Branch (131:7): [True: 34, False: 841]
  ------------------
  132|     34|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     34|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     34|        break;
  135|      0|      }
  136|     88|      case 6: {
  ------------------
  |  Branch (136:7): [True: 88, False: 787]
  ------------------
  137|     88|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     88|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     88|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 875]
  ------------------
  142|      0|        return false;
  143|    875|    }
  144|    875|  }
  145|       |
  146|    880|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 863, False: 17]
  ------------------
  147|    863|    return false;
  148|    863|  }
  149|     17|  return true;
  150|    880|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    880|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   277M|  Self& operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   277M|  const Self& operator=(const SourceType& source) {
   56|   277M|    *oit_ = Converter()(source);
   57|   277M|    return *this;
   58|   277M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   277M|  Point3ui operator()(const std::vector<uint32_t>& v) {
   30|   277M|    return Point3ui(v[0], v[1], v[2]);
   31|   277M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   277M|  const Self& operator++() {
   46|   277M|    ++oit_;
   47|   277M|    return *this;
   48|   277M|  }

_ZN5draco22FloatPointsTreeDecoder26set_num_points_from_headerEj:
   69|  1.04k|  void set_num_points_from_header(uint32_t num_points) {
   70|  1.04k|    num_points_from_header_ = num_points;
   71|  1.04k|  }
_ZN5draco22FloatPointsTreeDecoder16DecodePointCloudINS_34PointAttributeVectorOutputIteratorIfEEEEbPNS_13DecoderBufferERT_:
  102|  1.04k|                                              OutputIteratorT& out) {
  103|  1.04k|  std::vector<Point3ui> qpoints;
  104|       |
  105|  1.04k|  uint32_t decoded_version;
  106|  1.04k|  if (!buffer->Decode(&decoded_version)) {
  ------------------
  |  Branch (106:7): [True: 6, False: 1.03k]
  ------------------
  107|      6|    return false;
  108|      6|  }
  109|       |
  110|  1.03k|  if (decoded_version == 3) {
  ------------------
  |  Branch (110:7): [True: 3, False: 1.03k]
  ------------------
  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|  1.03k|  } else if (decoded_version == 2) {  // Version 2 only uses KDTREE method.
  ------------------
  |  Branch (126:14): [True: 992, False: 43]
  ------------------
  127|    992|    if (!DecodePointCloudKdTreeInternal(buffer, &qpoints)) {
  ------------------
  |  Branch (127:9): [True: 975, False: 17]
  ------------------
  128|    975|      return false;
  129|    975|    }
  130|    992|  } else {  // Unsupported version.
  131|     43|    fprintf(stderr, "Version not supported. \n");
  132|     43|    return false;
  133|     43|  }
  134|       |
  135|     17|  DequantizePoints3(qpoints.begin(), qpoints.end(), qinfo_, out);
  136|     17|  return true;
  137|  1.03k|}

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  21.9M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t* out_value) {
   58|  21.9M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 21.9M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  21.9M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  21.9M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  2.91G|  bool Decode(void* out_data, size_t size_to_decode) {
   77|  2.91G|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 528, False: 2.91G]
  ------------------
   78|    528|      return false;  // Buffer overflow.
   79|    528|    }
   80|  2.91G|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  2.91G|    pos_ += size_to_decode;
   82|  2.91G|    return true;
   83|  2.91G|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  52.6k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  22.5k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  73.7k|  const char* data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   245k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  9.77k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  21.9M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  6.23M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  11.5k|    void reset(const void* b, size_t s) {
  131|  11.5k|      bit_offset_ = 0;
  132|  11.5k|      bit_buffer_ = static_cast<const uint8_t*>(b);
  133|  11.5k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  11.5k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  9.81k|    uint64_t BitsDecoded() const { return static_cast<uint64_t>(bit_offset_); }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  158|  21.9M|    bool GetBits(uint32_t nbits, uint32_t* x) {
  159|  21.9M|      if (nbits > 32) {
  ------------------
  |  Branch (159:11): [True: 12, False: 21.9M]
  ------------------
  160|     12|        return false;
  161|     12|      }
  162|  21.9M|      uint32_t value = 0;
  163|  48.3M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (163:30): [True: 26.4M, False: 21.9M]
  ------------------
  164|  26.4M|        value |= GetBit() << bit;
  165|  26.4M|      }
  166|  21.9M|      *x = value;
  167|  21.9M|      return true;
  168|  21.9M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  173|  26.4M|    int GetBit() {
  174|  26.4M|      const size_t off = bit_offset_;
  175|  26.4M|      const size_t byte_offset = off >> 3;
  176|  26.4M|      const int bit_shift = static_cast<int>(off & 0x7);
  177|  26.4M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (177:11): [True: 24.6M, False: 1.76M]
  ------------------
  178|  24.6M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  179|  24.6M|        bit_offset_ = off + 1;
  180|  24.6M|        return bit;
  181|  24.6M|      }
  182|  1.76M|      return 0;
  183|  26.4M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  11.6M|  bool Decode(T* out_val) {
   69|  11.6M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 6.13k, False: 11.6M]
  ------------------
   70|  6.13k|      return false;
   71|  6.13k|    }
   72|  11.6M|    pos_ += sizeof(T);
   73|  11.6M|    return true;
   74|  11.6M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  11.6M|  bool Peek(T* out_val) {
   88|  11.6M|    const size_t size_to_decode = sizeof(T);
   89|  11.6M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 6.13k, False: 11.6M]
  ------------------
   90|  6.13k|      return false;  // Buffer overflow.
   91|  6.13k|    }
   92|  11.6M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  11.6M|    return true;
   94|  11.6M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  21.4k|  bool Decode(T* out_val) {
   69|  21.4k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 173, False: 21.3k]
  ------------------
   70|    173|      return false;
   71|    173|    }
   72|  21.3k|    pos_ += sizeof(T);
   73|  21.3k|    return true;
   74|  21.4k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  21.4k|  bool Peek(T* out_val) {
   88|  21.4k|    const size_t size_to_decode = sizeof(T);
   89|  21.4k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 173, False: 21.3k]
  ------------------
   90|    173|      return false;  // Buffer overflow.
   91|    173|    }
   92|  21.3k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  21.3k|    return true;
   94|  21.4k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   705k|  bool Decode(T* out_val) {
   69|   705k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 684, False: 704k]
  ------------------
   70|    684|      return false;
   71|    684|    }
   72|   704k|    pos_ += sizeof(T);
   73|   704k|    return true;
   74|   705k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   705k|  bool Peek(T* out_val) {
   88|   705k|    const size_t size_to_decode = sizeof(T);
   89|   705k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 684, False: 704k]
  ------------------
   90|    684|      return false;  // Buffer overflow.
   91|    684|    }
   92|   704k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   704k|    return true;
   94|   705k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  32.2k|  bool Decode(T* out_val) {
   69|  32.2k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 234, False: 32.0k]
  ------------------
   70|    234|      return false;
   71|    234|    }
   72|  32.0k|    pos_ += sizeof(T);
   73|  32.0k|    return true;
   74|  32.2k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  32.2k|  bool Peek(T* out_val) {
   88|  32.2k|    const size_t size_to_decode = sizeof(T);
   89|  32.2k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 234, False: 32.0k]
  ------------------
   90|    234|      return false;  // Buffer overflow.
   91|    234|    }
   92|  32.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  32.0k|    return true;
   94|  32.2k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   807k|  bool Decode(T* out_val) {
   69|   807k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 141, False: 806k]
  ------------------
   70|    141|      return false;
   71|    141|    }
   72|   806k|    pos_ += sizeof(T);
   73|   806k|    return true;
   74|   807k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   807k|  bool Peek(T* out_val) {
   88|   807k|    const size_t size_to_decode = sizeof(T);
   89|   807k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 141, False: 806k]
  ------------------
   90|    141|      return false;  // Buffer overflow.
   91|    141|    }
   92|   806k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   806k|    return true;
   94|   807k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  68.8k|  bool Decode(T* out_val) {
   69|  68.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 47, False: 68.8k]
  ------------------
   70|     47|      return false;
   71|     47|    }
   72|  68.8k|    pos_ += sizeof(T);
   73|  68.8k|    return true;
   74|  68.8k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  68.8k|  bool Peek(T* out_val) {
   88|  68.8k|    const size_t size_to_decode = sizeof(T);
   89|  68.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 47, False: 68.8k]
  ------------------
   90|     47|      return false;  // Buffer overflow.
   91|     47|    }
   92|  68.8k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  68.8k|    return true;
   94|  68.8k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.98k|  bool Decode(T* out_val) {
   69|  1.98k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 55, False: 1.92k]
  ------------------
   70|     55|      return false;
   71|     55|    }
   72|  1.92k|    pos_ += sizeof(T);
   73|  1.92k|    return true;
   74|  1.98k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.98k|  bool Peek(T* out_val) {
   88|  1.98k|    const size_t size_to_decode = sizeof(T);
   89|  1.98k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 55, False: 1.92k]
  ------------------
   90|     55|      return false;  // Buffer overflow.
   91|     55|    }
   92|  1.92k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.92k|    return true;
   94|  1.98k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|  1.25k|  bool Decode(T* out_val) {
   69|  1.25k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 11, False: 1.24k]
  ------------------
   70|     11|      return false;
   71|     11|    }
   72|  1.24k|    pos_ += sizeof(T);
   73|  1.24k|    return true;
   74|  1.25k|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|  1.25k|  bool Peek(T* out_val) {
   88|  1.25k|    const size_t size_to_decode = sizeof(T);
   89|  1.25k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 11, False: 1.24k]
  ------------------
   90|     11|      return false;  // Buffer overflow.
   91|     11|    }
   92|  1.24k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.24k|    return true;
   94|  1.25k|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   680M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   581M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  16.0M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|  16.0M|    return value_ >= val;
  100|  16.0M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   366M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  4.40G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  36.9M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   154M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   154M|    value_ = i.value_;
  153|   154M|    return *this;
  154|   154M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|  3.06G|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  3.06G|    value_ = i.value_;
  153|  3.06G|    return *this;
  154|  3.06G|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  36.9M|  inline ThisIndexType& operator++() {
  103|  36.9M|    ++value_;
  104|  36.9M|    return *this;
  105|  36.9M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  3.27G|  constexpr bool operator==(const IndexType& i) const {
   76|  3.27G|    return value_ == i.value_;
   77|  3.27G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  1.26G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  5.24k|  constexpr bool operator<(const IndexType& i) const {
   88|  5.24k|    return value_ < i.value_;
   89|  5.24k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   169M|  constexpr bool operator==(const IndexType& i) const {
   76|   169M|    return value_ == i.value_;
   77|   169M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   271M|  constexpr ThisIndexType operator-(const ValueTypeT& val) const {
  132|   271M|    return ThisIndexType(value_ - val);
  133|   271M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   939M|  constexpr ThisIndexType operator+(const ValueTypeT& val) const {
  126|   939M|    return ThisIndexType(value_ + val);
  127|   939M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  35.6M|  constexpr bool operator==(const IndexType& i) const {
   76|  35.6M|    return value_ == i.value_;
   77|  35.6M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   329M|  constexpr bool operator!=(const IndexType& i) const {
   82|   329M|    return value_ != i.value_;
   83|   329M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   495M|  constexpr bool operator!=(const IndexType& i) const {
   82|   495M|    return value_ != i.value_;
   83|   495M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   693M|  inline ThisIndexType& operator++() {
  103|   693M|    ++value_;
  104|   693M|    return *this;
  105|   693M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   555M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   555M|    value_ = i.value_;
  153|   555M|    return *this;
  154|   555M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.39G|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  1.39G|    value_ = i.value_;
  153|  1.39G|    return *this;
  154|  1.39G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  62.5M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|  62.5M|    return value_ >= val;
  100|  62.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  16.2M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.47G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  29.3G|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   276M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  22.6G|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   326M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  18.6M|  constexpr ThisIndexType operator+(const ValueTypeT& val) const {
  126|  18.6M|    return ThisIndexType(value_ + val);
  127|  18.6M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   212M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  48.1M|  constexpr bool operator<(const IndexType& i) const {
   88|  48.1M|    return value_ < i.value_;
   89|  48.1M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   764M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  3.06G|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|   107M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   534M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   969M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  8.80M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  8.80M|    value_ = i.value_;
  153|  8.80M|    return *this;
  154|  8.80M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  16.1M|  inline ThisIndexType operator+=(const ValueTypeT& val) {
  140|  16.1M|    value_ += val;
  141|  16.1M|    return *this;
  142|  16.1M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  48.1M|  inline ThisIndexType& operator=(const ValueTypeT& val) {
  156|  48.1M|    value_ = val;
  157|  48.1M|    return *this;
  158|  48.1M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  3.01G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  9.42M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  9.41M|  inline ThisIndexType& operator++() {
  103|  9.41M|    ++value_;
  104|  9.41M|    return *this;
  105|  9.41M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  38.5M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|  60.9M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   460M|  inline ThisIndexType& operator++() {
  103|   460M|    ++value_;
  104|   460M|    return *this;
  105|   460M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|  60.9M|  inline ThisIndexType& operator++() {
  103|  60.9M|    ++value_;
  104|  60.9M|    return *this;
  105|  60.9M|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   422M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|   422M|    return value_ >= val;
  100|   422M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  58.2M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  58.2M|    return vector_[index.value()];
   75|  58.2M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  38.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  19.7k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  28.5k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|   101M|  inline reference operator[](const IndexTypeT& index) {
   71|   101M|    return vector_[index.value()];
   72|   101M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  6.22k|  void push_back(const ValueTypeT& val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  32.1M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  6.20k|  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|  16.0M|  inline reference operator[](const IndexTypeT& index) {
   71|  16.0M|    return vector_[index.value()];
   72|  16.0M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  38.0M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  38.0M|    return vector_[index.value()];
   75|  38.0M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   261M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  19.0M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   442M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|   442M|    return vector_[index.value()];
   75|   442M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  1.11G|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  1.11G|    return vector_[index.value()];
   75|  1.11G|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   501M|  inline reference operator[](const IndexTypeT& index) {
   71|   501M|    return vector_[index.value()];
   72|   501M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  71.2M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  71.2M|    return vector_[index.value()];
   75|  71.2M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   408M|  inline reference operator[](const IndexTypeT& index) {
   71|   408M|    return vector_[index.value()];
   72|   408M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   131M|  void push_back(const ValueTypeT& val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   282M|  inline reference operator[](const IndexTypeT& index) {
   71|   282M|    return vector_[index.value()];
   72|   282M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  3.11k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   304M|  inline reference operator[](const IndexTypeT& index) {
   71|   304M|    return vector_[index.value()];
   72|   304M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  90.5k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  4.68M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  85.8k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  10.8k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  10.8k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  10.8k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  10.8k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  21.7k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  21.7k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT>& arg) {
   56|  21.7k|    vector_.swap(arg.vector_);
   57|  21.7k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  21.7k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  21.7k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT>& arg) {
   56|  21.7k|    vector_.swap(arg.vector_);
   57|  21.7k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  10.8k|  void assign(size_t size, const ValueTypeT& val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  10.8k|  void assign(size_t size, const ValueTypeT& val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  10.8k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  18.8k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  54.9k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|   103k|int32_t DataTypeLength(DataType dt) {
   20|   103k|  switch (dt) {
   21|  34.4k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 34.4k, False: 69.5k]
  ------------------
   22|  41.4k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 7.06k, False: 96.8k]
  ------------------
   23|  41.4k|      return 1;
   24|  8.92k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 8.92k, False: 94.9k]
  ------------------
   25|  11.6k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 2.70k, False: 101k]
  ------------------
   26|  11.6k|      return 2;
   27|  41.8k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 41.8k, False: 62.0k]
  ------------------
   28|  44.3k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 2.47k, False: 101k]
  ------------------
   29|  44.3k|      return 4;
   30|    184|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 184, False: 103k]
  ------------------
   31|    703|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 519, False: 103k]
  ------------------
   32|    703|      return 8;
   33|  5.30k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 5.30k, False: 98.6k]
  ------------------
   34|  5.30k|      return 4;
   35|    210|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 210, False: 103k]
  ------------------
   36|    210|      return 8;
   37|    260|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 260, False: 103k]
  ------------------
   38|    260|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 103k]
  ------------------
   40|      0|      return -1;
   41|   103k|  }
   42|   103k|}

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

_ZN5draco7IntSqrtEm:
   31|  1.53k|inline uint64_t IntSqrt(uint64_t number) {
   32|  1.53k|  if (number == 0) {
  ------------------
  |  Branch (32:7): [True: 105, False: 1.42k]
  ------------------
   33|    105|    return 0;
   34|    105|  }
   35|       |  // First estimate good initial value of the square root as log2(number).
   36|  1.42k|  uint64_t act_number = number;
   37|  1.42k|  uint64_t square_root = 1;
   38|  19.9k|  while (act_number >= 2) {
  ------------------
  |  Branch (38:10): [True: 18.4k, False: 1.42k]
  ------------------
   39|       |    // Double the square root until |square_root * square_root > number|.
   40|  18.4k|    square_root *= 2;
   41|  18.4k|    act_number /= 4;
   42|  18.4k|  }
   43|       |  // Perform Newton's (or Babylonian) method to find the true floor(sqrt()).
   44|  3.40k|  do {
   45|       |    // New |square_root| estimate is computed as the average between
   46|       |    // |square_root| and |number / square_root|.
   47|  3.40k|    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|  3.40k|  } while (square_root * square_root > number);
  ------------------
  |  Branch (53:12): [True: 1.97k, False: 1.42k]
  ------------------
   54|  1.42k|  return square_root;
   55|  1.53k|}

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  3.75k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|      9|  StatusOr(const Status& status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  18.8k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|      8|  StatusOr(const Status& status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|     57|  StatusOr(const Status& status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  22.5k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  22.6k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|     57|  const Status& status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  20.2k|  StatusOr(const Status& status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  22.5k|  T&& value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  2.43k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  3.76k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|      9|  const Status& status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  3.75k|  T&& value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  18.8k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|      8|  const Status& status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  18.8k|  T&& value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   974k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|   974k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 974k, Folded]
  ------------------
   65|   974k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 2.23k, False: 972k]
  ------------------
   66|  2.23k|      return false;
   67|  2.23k|    }
   68|   974k|  } 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|   972k|  return true;
   77|   974k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   702k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|   702k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   702k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 90, False: 702k]
  ------------------
   33|     90|    return false;
   34|     90|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   702k|  uint8_t in;
   39|   702k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1.35k, False: 700k]
  ------------------
   40|  1.35k|    return false;
   41|  1.35k|  }
   42|   700k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 28.9k, False: 672k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  28.9k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 650, False: 28.3k]
  ------------------
   45|    650|      return false;
   46|    650|    }
   47|       |    // Append decoded info from this byte.
   48|  28.3k|    *out_val <<= 7;
   49|  28.3k|    *out_val |= in & ((1 << 7) - 1);
   50|   672k|  } else {
   51|       |    // Last byte reached
   52|   672k|    *out_val = in;
   53|   672k|  }
   54|   700k|  return true;
   55|   700k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  15.7k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  15.7k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  15.7k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 15.7k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  15.7k|  uint8_t in;
   39|  15.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 53, False: 15.7k]
  ------------------
   40|     53|    return false;
   41|     53|  }
   42|  15.7k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.74k, False: 13.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.74k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 45, False: 1.69k]
  ------------------
   45|     45|      return false;
   46|     45|    }
   47|       |    // Append decoded info from this byte.
   48|  1.69k|    *out_val <<= 7;
   49|  1.69k|    *out_val |= in & ((1 << 7) - 1);
   50|  13.9k|  } else {
   51|       |    // Last byte reached
   52|  13.9k|    *out_val = in;
   53|  13.9k|  }
   54|  15.6k|  return true;
   55|  15.7k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  11.2k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|  11.2k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 11.2k, Folded]
  ------------------
   65|  11.2k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 196, False: 11.0k]
  ------------------
   66|    196|      return false;
   67|    196|    }
   68|  11.2k|  } 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|  11.0k|  return true;
   77|  11.2k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  6.95k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  6.95k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.95k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 6.95k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.95k|  uint8_t in;
   39|  6.95k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 51, False: 6.89k]
  ------------------
   40|     51|    return false;
   41|     51|  }
   42|  6.89k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 463, False: 6.43k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    463|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 28, False: 435]
  ------------------
   45|     28|      return false;
   46|     28|    }
   47|       |    // Append decoded info from this byte.
   48|    435|    *out_val <<= 7;
   49|    435|    *out_val |= in & ((1 << 7) - 1);
   50|  6.43k|  } else {
   51|       |    // Last byte reached
   52|  6.43k|    *out_val = in;
   53|  6.43k|  }
   54|  6.87k|  return true;
   55|  6.89k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   176k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|   176k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   176k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 13, False: 176k]
  ------------------
   33|     13|    return false;
   34|     13|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   176k|  uint8_t in;
   39|   176k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 273, False: 176k]
  ------------------
   40|    273|    return false;
   41|    273|  }
   42|   176k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.81k, False: 173k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.81k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 118, False: 2.69k]
  ------------------
   45|    118|      return false;
   46|    118|    }
   47|       |    // Append decoded info from this byte.
   48|  2.69k|    *out_val <<= 7;
   49|  2.69k|    *out_val |= in & ((1 << 7) - 1);
   50|   173k|  } else {
   51|       |    // Last byte reached
   52|   173k|    *out_val = in;
   53|   173k|  }
   54|   176k|  return true;
   55|   176k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  6.03k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|  6.03k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 6.03k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  6.03k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  6.03k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  6.03k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 76, False: 5.95k]
  ------------------
   72|     76|      return false;
   73|     76|    }
   74|  5.95k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  5.95k|  }
   76|  5.95k|  return true;
   77|  6.03k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  7.03k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  7.03k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.03k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 16, False: 7.01k]
  ------------------
   33|     16|    return false;
   34|     16|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.01k|  uint8_t in;
   39|  7.01k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 60, False: 6.95k]
  ------------------
   40|     60|    return false;
   41|     60|  }
   42|  6.95k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 995, False: 5.95k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    995|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 98, False: 897]
  ------------------
   45|     98|      return false;
   46|     98|    }
   47|       |    // Append decoded info from this byte.
   48|    897|    *out_val <<= 7;
   49|    897|    *out_val |= in & ((1 << 7) - 1);
   50|  5.95k|  } else {
   51|       |    // Last byte reached
   52|  5.95k|    *out_val = in;
   53|  5.95k|  }
   54|  6.85k|  return true;
   55|  6.95k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.23k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  6.23k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.23k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 6.23k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.23k|  uint8_t in;
   39|  6.23k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 40, False: 6.19k]
  ------------------
   40|     40|    return false;
   41|     40|  }
   42|  6.19k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 977, False: 5.21k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    977|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 44, False: 933]
  ------------------
   45|     44|      return false;
   46|     44|    }
   47|       |    // Append decoded info from this byte.
   48|    933|    *out_val <<= 7;
   49|    933|    *out_val |= in & ((1 << 7) - 1);
   50|  5.21k|  } else {
   51|       |    // Last byte reached
   52|  5.21k|    *out_val = in;
   53|  5.21k|  }
   54|  6.14k|  return true;
   55|  6.19k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  41.2k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  41.2k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  41.2k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 8, False: 41.2k]
  ------------------
   33|      8|    return false;
   34|      8|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  41.2k|  uint8_t in;
   39|  41.2k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 53, False: 41.1k]
  ------------------
   40|     53|    return false;
   41|     53|  }
   42|  41.1k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 829, False: 40.3k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    829|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 68, False: 761]
  ------------------
   45|     68|      return false;
   46|     68|    }
   47|       |    // Append decoded info from this byte.
   48|    761|    *out_val <<= 7;
   49|    761|    *out_val |= in & ((1 << 7) - 1);
   50|  40.3k|  } else {
   51|       |    // Last byte reached
   52|  40.3k|    *out_val = in;
   53|  40.3k|  }
   54|  41.1k|  return true;
   55|  41.1k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  13.0k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  13.0k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  13.0k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 95, False: 12.9k]
  ------------------
   33|     95|    return false;
   34|     95|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  12.9k|  uint8_t in;
   39|  12.9k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 129, False: 12.7k]
  ------------------
   40|    129|    return false;
   41|    129|  }
   42|  12.7k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.08k, False: 9.69k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.08k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 526, False: 2.55k]
  ------------------
   45|    526|      return false;
   46|    526|    }
   47|       |    // Append decoded info from this byte.
   48|  2.55k|    *out_val <<= 7;
   49|  2.55k|    *out_val |= in & ((1 << 7) - 1);
   50|  9.69k|  } else {
   51|       |    // Last byte reached
   52|  9.69k|    *out_val = in;
   53|  9.69k|  }
   54|  12.2k|  return true;
   55|  12.7k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  10.4k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  10.4k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  10.4k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 49, False: 10.4k]
  ------------------
   33|     49|    return false;
   34|     49|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  10.4k|  uint8_t in;
   39|  10.4k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 95, False: 10.3k]
  ------------------
   40|     95|    return false;
   41|     95|  }
   42|  10.3k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 5.70k, False: 4.63k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  5.70k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 599, False: 5.10k]
  ------------------
   45|    599|      return false;
   46|    599|    }
   47|       |    // Append decoded info from this byte.
   48|  5.10k|    *out_val <<= 7;
   49|  5.10k|    *out_val |= in & ((1 << 7) - 1);
   50|  5.10k|  } else {
   51|       |    // Last byte reached
   52|  4.63k|    *out_val = in;
   53|  4.63k|  }
   54|  9.73k|  return true;
   55|  10.3k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  63.7k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  63.7k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  63.7k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 63.7k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  63.7k|  uint8_t in;
   39|  63.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 117, False: 63.6k]
  ------------------
   40|    117|    return false;
   41|    117|  }
   42|  63.6k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 6.29k, False: 57.3k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  6.29k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 65, False: 6.23k]
  ------------------
   45|     65|      return false;
   46|     65|    }
   47|       |    // Append decoded info from this byte.
   48|  6.23k|    *out_val <<= 7;
   49|  6.23k|    *out_val |= in & ((1 << 7) - 1);
   50|  57.3k|  } else {
   51|       |    // Last byte reached
   52|  57.3k|    *out_val = in;
   53|  57.3k|  }
   54|  63.5k|  return true;
   55|  63.6k|}

_ZN5draco7VectorDIfLi3EEC2Ev:
   42|  56.3k|  VectorD() {
   43|   225k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 168k, False: 56.3k]
  ------------------
   44|   168k|      (*this)[i] = Scalar(0);
   45|   168k|    }
   46|  56.3k|  }
_ZN5draco7VectorDIfLi3EEixEi:
  114|   271k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEixEi:
  115|   210k|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEixEi:
  114|  1.87G|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   61|     71|      : v_({{c0, c1, c2}}) {
   62|     71|    DRACO_DCHECK_EQ(dimension, 3);
   63|     71|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  115|   140M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  139|  15.5M|  Self operator-(const Self& o) const {
  140|  15.5M|    Self ret;
  141|  62.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 46.5M, False: 15.5M]
  ------------------
  142|  46.5M|      ret[i] = (*this)[i] - o[i];
  143|  46.5M|    }
  144|  15.5M|    return ret;
  145|  15.5M|  }
_ZN5draco12CrossProductIlTnPNSt3__19enable_ifIXaasr3std11is_integralIT_EE5valuesr3std9is_signedIS3_EE5valueEvE4typeELPv0EEENS_7VectorDIS3_Li3EEERKS9_SB_:
  325|  7.73M|                                 const VectorD<ScalarT, 3>& v) {
  326|       |  // Preventing accidental use with uint32_t and the like.
  327|  7.73M|  static_assert(std::is_signed<ScalarT>::value,
  328|  7.73M|                "ScalarT must be a signed type. ");
  329|  7.73M|  VectorD<ScalarT, 3> r;
  330|  7.73M|  typedef typename std::make_unsigned<ScalarT>::type ScalarUT;
  331|  7.73M|  const ScalarUT u0 = static_cast<ScalarUT>(u[0]);
  332|  7.73M|  const ScalarUT u1 = static_cast<ScalarUT>(u[1]);
  333|  7.73M|  const ScalarUT u2 = static_cast<ScalarUT>(u[2]);
  334|  7.73M|  const ScalarUT v0 = static_cast<ScalarUT>(v[0]);
  335|  7.73M|  const ScalarUT v1 = static_cast<ScalarUT>(v[1]);
  336|  7.73M|  const ScalarUT v2 = static_cast<ScalarUT>(v[2]);
  337|  7.73M|  r[0] = static_cast<ScalarT>((u1 * v2) - (u2 * v1));
  338|  7.73M|  r[1] = static_cast<ScalarT>((u2 * v0) - (u0 * v2));
  339|  7.73M|  r[2] = static_cast<ScalarT>((u0 * v1) - (u1 * v0));
  340|  7.73M|  return r;
  341|  7.73M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  284|  7.73M|  Scalar* data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  285|  7.73M|  const Scalar* data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  239|  4.06M|  Scalar AbsSum() const {
  240|  4.06M|    Scalar result(0);
  241|  16.2M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (241:21): [True: 12.1M, False: 4.04M]
  ------------------
  242|  12.1M|      Scalar next_value = std::abs(v_[i]);
  243|  12.1M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (243:11): [True: 13.8k, False: 12.1M]
  ------------------
  244|       |        // Return the max if adding would have caused an overflow.
  245|  13.8k|        return std::numeric_limits<Scalar>::max();
  246|  13.8k|      }
  247|  12.1M|      result += next_value;
  248|  12.1M|    }
  249|  4.04M|    return result;
  250|  4.06M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  184|   222k|  Self operator/(const Scalar& o) const {
  185|   222k|    Self ret;
  186|   889k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (186:21): [True: 667k, False: 222k]
  ------------------
  187|   667k|      ret[i] = (*this)[i] / o;
  188|   667k|    }
  189|   222k|    return ret;
  190|   222k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  114|   243M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  114|  22.2M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  284|  12.1M|  Scalar* data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  122|  3.71M|  Self operator-() const {
  123|  3.71M|    Self ret;
  124|  14.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (124:21): [True: 11.1M, False: 3.71M]
  ------------------
  125|  11.1M|      ret[i] = -(*this)[i];
  126|  11.1M|    }
  127|  3.71M|    return ret;
  128|  3.71M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  115|  11.1M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  139|  37.5M|  Self operator-(const Self& o) const {
  140|  37.5M|    Self ret;
  141|   112M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 75.1M, False: 37.5M]
  ------------------
  142|  75.1M|      ret[i] = (*this)[i] - o[i];
  143|  75.1M|    }
  144|  37.5M|    return ret;
  145|  37.5M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  114|   451M|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  115|   676M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  114|  4.35G|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  131|  75.1M|  Self operator+(const Self& o) const {
  132|  75.1M|    Self ret;
  133|   225M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 150M, False: 75.1M]
  ------------------
  134|   150M|      ret[i] = (*this)[i] + o[i];
  135|   150M|    }
  136|  75.1M|    return ret;
  137|  75.1M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  115|  3.30G|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  139|   150M|  Self operator-(const Self& o) const {
  140|   150M|    Self ret;
  141|   450M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 300M, False: 150M]
  ------------------
  142|   300M|      ret[i] = (*this)[i] - o[i];
  143|   300M|    }
  144|   150M|    return ret;
  145|   150M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  131|   150M|  Self operator+(const Self& o) const {
  132|   150M|    Self ret;
  133|   450M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 300M, False: 150M]
  ------------------
  134|   300M|      ret[i] = (*this)[i] + o[i];
  135|   300M|    }
  136|   150M|    return ret;
  137|   150M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  208|   640k|  bool operator==(const Self& o) const {
  209|  1.90M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (209:21): [True: 1.27M, False: 629k]
  ------------------
  210|  1.27M|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (210:11): [True: 11.0k, False: 1.26M]
  ------------------
  211|  11.0k|        return false;
  212|  11.0k|      }
  213|  1.27M|    }
  214|   629k|    return true;
  215|   640k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  115|  7.69M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  139|  22.6k|  Self operator-(const Self& o) const {
  140|  22.6k|    Self ret;
  141|  90.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 67.9k, False: 22.6k]
  ------------------
  142|  67.9k|      ret[i] = (*this)[i] - o[i];
  143|  67.9k|    }
  144|  22.6k|    return ret;
  145|  22.6k|  }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  236|  11.5k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  252|  12.1k|  Scalar Dot(const Self& o) const {
  253|  12.1k|    Scalar ret(0);
  254|  48.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (254:21): [True: 36.4k, False: 12.1k]
  ------------------
  255|  36.4k|      ret += (*this)[i] * o[i];
  256|  36.4k|    }
  257|  12.1k|    return ret;
  258|  12.1k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  176|    558|  Self operator*(const Scalar& o) const {
  177|    558|    Self ret;
  178|  2.23k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 1.67k, False: 558]
  ------------------
  179|  1.67k|      ret[i] = (*this)[i] * o;
  180|  1.67k|    }
  181|    558|    return ret;
  182|    558|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  139|  11.0k|  Self operator-(const Self& o) const {
  140|  11.0k|    Self ret;
  141|  33.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 22.0k, False: 11.0k]
  ------------------
  142|  22.0k|      ret[i] = (*this)[i] - o[i];
  143|  22.0k|    }
  144|  11.0k|    return ret;
  145|  11.0k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   42|  22.0k|  VectorD() {
   43|  66.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 44.1k, False: 22.0k]
  ------------------
   44|  44.1k|      (*this)[i] = Scalar(0);
   45|  44.1k|    }
   46|  22.0k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   54|  1.29M|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|  1.29M|    DRACO_DCHECK_EQ(dimension, 2);
   56|  1.29M|    v_[0] = c0;
   57|  1.29M|    v_[1] = c1;
   58|  1.29M|  }
_ZN5draco7VectorDIfLi2EEixEi:
  114|  88.1k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  208|   664k|  bool operator==(const Self& o) const {
  209|  1.93M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (209:21): [True: 1.30M, False: 635k]
  ------------------
  210|  1.30M|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (210:11): [True: 28.3k, False: 1.27M]
  ------------------
  211|  28.3k|        return false;
  212|  28.3k|      }
  213|  1.30M|    }
  214|   635k|    return true;
  215|   664k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  115|  3.90M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   42|  47.1M|  VectorD() {
   43|   188M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 141M, False: 47.1M]
  ------------------
   44|   141M|      (*this)[i] = Scalar(0);
   45|   141M|    }
   46|  47.1M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  236|  29.8k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  252|  31.5k|  Scalar Dot(const Self& o) const {
  253|  31.5k|    Scalar ret(0);
  254|   126k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (254:21): [True: 94.6k, False: 31.5k]
  ------------------
  255|  94.6k|      ret += (*this)[i] * o[i];
  256|  94.6k|    }
  257|  31.5k|    return ret;
  258|  31.5k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  139|  1.66k|  Self operator-(const Self& o) const {
  140|  1.66k|    Self ret;
  141|  5.00k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 3.33k, False: 1.66k]
  ------------------
  142|  3.33k|      ret[i] = (*this)[i] - o[i];
  143|  3.33k|    }
  144|  1.66k|    return ret;
  145|  1.66k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  104|  5.91k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  17.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 11.8k, False: 5.91k]
  ------------------
  106|  11.8k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 11.8k, False: 0]
  ------------------
  107|  11.8k|        v_[i] = Scalar(src_vector[i]);
  108|  11.8k|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  11.8k|    }
  112|  5.91k|  }
_ZNK5draco7VectorDImLi2EEmlERKm:
  176|  3.11k|  Self operator*(const Scalar& o) const {
  177|  3.11k|    Self ret;
  178|  9.34k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 6.23k, False: 3.11k]
  ------------------
  179|  6.23k|      ret[i] = (*this)[i] * o;
  180|  6.23k|    }
  181|  3.11k|    return ret;
  182|  3.11k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   42|  6.07k|  VectorD() {
   43|  18.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 12.1k, False: 6.07k]
  ------------------
   44|  12.1k|      (*this)[i] = Scalar(0);
   45|  12.1k|    }
   46|  6.07k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  115|  23.9k|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  114|  24.2k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  131|  2.49k|  Self operator+(const Self& o) const {
  132|  2.49k|    Self ret;
  133|  7.49k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 4.99k, False: 2.49k]
  ------------------
  134|  4.99k|      ret[i] = (*this)[i] + o[i];
  135|  4.99k|    }
  136|  2.49k|    return ret;
  137|  2.49k|  }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  104|  2.95k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  8.87k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 5.91k, False: 2.95k]
  ------------------
  106|  5.91k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 5.91k, False: 0]
  ------------------
  107|  5.91k|        v_[i] = Scalar(src_vector[i]);
  108|  5.91k|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  5.91k|    }
  112|  2.95k|  }
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  131|  1.53k|  Self operator+(const Self& o) const {
  132|  1.53k|    Self ret;
  133|  6.12k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 4.59k, False: 1.53k]
  ------------------
  134|  4.59k|      ret[i] = (*this)[i] + o[i];
  135|  4.59k|    }
  136|  1.53k|    return ret;
  137|  1.53k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  294|  1.53k|    const ScalarT& o, const VectorD<ScalarT, dimension_t>& v) {
  295|  1.53k|  return v * o;
  296|  1.53k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  176|  1.53k|  Self operator*(const Scalar& o) const {
  177|  1.53k|    Self ret;
  178|  6.12k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 4.59k, False: 1.53k]
  ------------------
  179|  4.59k|      ret[i] = (*this)[i] * o;
  180|  4.59k|    }
  181|  1.53k|    return ret;
  182|  1.53k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   54|  1.32M|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|  1.32M|    DRACO_DCHECK_EQ(dimension, 2);
   56|  1.32M|    v_[0] = c0;
   57|  1.32M|    v_[1] = c1;
   58|  1.32M|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  176|  1.53k|  Self operator*(const Scalar& o) const {
  177|  1.53k|    Self ret;
  178|  4.59k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 3.06k, False: 1.53k]
  ------------------
  179|  3.06k|      ret[i] = (*this)[i] * o;
  180|  3.06k|    }
  181|  1.53k|    return ret;
  182|  1.53k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   42|  6.13k|  VectorD() {
   43|  18.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 12.2k, False: 6.13k]
  ------------------
   44|  12.2k|      (*this)[i] = Scalar(0);
   45|  12.2k|    }
   46|  6.13k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  184|  1.39k|  Self operator/(const Scalar& o) const {
  185|  1.39k|    Self ret;
  186|  4.19k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (186:21): [True: 2.79k, False: 1.39k]
  ------------------
  187|  2.79k|      ret[i] = (*this)[i] / o;
  188|  2.79k|    }
  189|  1.39k|    return ret;
  190|  1.39k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  139|    460|  Self operator-(const Self& o) const {
  140|    460|    Self ret;
  141|  1.38k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 920, False: 460]
  ------------------
  142|    920|      ret[i] = (*this)[i] - o[i];
  143|    920|    }
  144|    460|    return ret;
  145|    460|  }
_ZN5draco7VectorDIlLi2EEixEi:
  114|  24.2k|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   42|  3.71M|  VectorD() {
   43|  14.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 11.1M, False: 3.71M]
  ------------------
   44|  11.1M|      (*this)[i] = Scalar(0);
   45|  11.1M|    }
   46|  3.71M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   54|   714M|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|   714M|    DRACO_DCHECK_EQ(dimension, 2);
   56|   714M|    v_[0] = c0;
   57|   714M|    v_[1] = c1;
   58|   714M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  104|   225M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|   676M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 451M, False: 225M]
  ------------------
  106|   451M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 451M, False: 0]
  ------------------
  107|   451M|        v_[i] = Scalar(src_vector[i]);
  108|   451M|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|   451M|    }
  112|   225M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   42|   112M|  VectorD() {
   43|   338M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 225M, False: 112M]
  ------------------
   44|   225M|      (*this)[i] = Scalar(0);
   45|   225M|    }
   46|   112M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  104|   112M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|   338M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 225M, False: 112M]
  ------------------
  106|   225M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 225M, False: 0]
  ------------------
  107|   225M|        v_[i] = Scalar(src_vector[i]);
  108|   225M|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|   225M|    }
  112|   112M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   90|   488M|  VectorD(const Self& o) {
   91|  1.46G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (91:21): [True: 977M, False: 488M]
  ------------------
   92|   977M|      (*this)[i] = o[i];
   93|   977M|    }
   94|   488M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   42|   300M|  VectorD() {
   43|   901M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 601M, False: 300M]
  ------------------
   44|   601M|      (*this)[i] = Scalar(0);
   45|   601M|    }
   46|   300M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   90|   624M|  VectorD(const Self& o) {
   91|  2.49G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (91:21): [True: 1.87G, False: 624M]
  ------------------
   92|  1.87G|      (*this)[i] = o[i];
   93|  1.87G|    }
   94|   624M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  115|  1.87G|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   61|   277M|      : v_({{c0, c1, c2}}) {
   62|   277M|    DRACO_DCHECK_EQ(dimension, 3);
   63|   277M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   130M|  inline int num_vertices() const {
   74|   130M|    return static_cast<int>(vertex_corners_.size());
   75|   130M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  16.2M|  inline int num_corners() const {
   77|  16.2M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  16.2M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  2.82M|  inline int num_faces() const {
   80|  2.82M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  2.82M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   442M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   442M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 442M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   442M|    return opposite_corners_[corner];
   88|   442M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   711M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   711M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 18.6M, False: 693M]
  ------------------
   91|  18.6M|      return corner;
   92|  18.6M|    }
   93|   693M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 619M, False: 73.6M]
  ------------------
   94|   711M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   649M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   649M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 7.05M, False: 642M]
  ------------------
   97|  7.05M|      return corner;
   98|  7.05M|    }
   99|   642M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 197M, False: 444M]
  ------------------
  100|   649M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.11G|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  1.11G|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1.11G]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  1.11G|    return ConfidentVertex(corner);
  106|  1.11G|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  1.11G|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  1.11G|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  1.11G|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  1.11G|    return corner_to_vertex_map_[corner];
  111|  1.11G|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  64.3M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  64.3M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 64.3M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  64.3M|    return FaceIndex(corner.value() / 3);
  117|  64.3M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.33G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  71.2M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  71.2M|    return vertex_corners_[v];
  152|  71.2M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.64M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.64M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.64M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 40.8k, False: 1.60M]
  ------------------
  188|  40.8k|      return true;
  189|  40.8k|    }
  190|  1.60M|    return false;
  191|  1.64M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|   115M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|   115M|    return Previous(Opposite(Previous(corner)));
  202|   115M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  23.9M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  23.9M|    return Next(Opposite(Next(corner)));
  207|  23.9M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  6.33M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  6.33M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 6.33M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  6.33M|    return Opposite(Previous(corner_id));
  222|  6.33M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  7.94M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  7.94M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 7.94M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  7.94M|    return Opposite(Next(corner_id));
  228|  7.94M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   408M|                                CornerIndex opp_corner_id) {
  249|   408M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   408M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   408M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   501M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   501M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   501M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   501M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   131M|  VertexIndex AddNewVertex() {
  271|   131M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   131M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   131M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   131M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   281M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   281M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   281M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 281M, False: 0]
  ------------------
  295|   281M|      vertex_corners_[vert] = corner;
  296|   281M|    }
  297|   281M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  1.22M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  1.22M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  1.22M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  1.22M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  4.41k|      : corner_table_(table),
  229|  4.41k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  4.41k|        corner_(start_corner_),
  231|  4.41k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.49M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  15.6k|  VertexCornersIterator& operator++() {
  268|  15.6k|    Next();
  269|  15.6k|    return *this;
  270|  15.6k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.83M|  void Next() {
  248|  3.83M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.80M, False: 32.6k]
  ------------------
  249|  3.80M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.80M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 30.0k, False: 3.77M]
  ------------------
  251|       |        // Open boundary reached.
  252|  30.0k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  30.0k|        left_traversal_ = false;
  254|  3.77M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 629k, False: 3.14M]
  ------------------
  255|       |        // End reached.
  256|   629k|        corner_ = kInvalidCornerIndex;
  257|   629k|      }
  258|  3.80M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  32.6k|      corner_ = corner_table_->SwingRight(corner_);
  262|  32.6k|    }
  263|  3.83M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  7.64M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  7.32M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  7.83M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  3.91M|  void Next() {
  248|  3.91M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.88M, False: 28.5k]
  ------------------
  249|  3.88M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.88M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 3.31M, False: 574k]
  ------------------
  251|       |        // Open boundary reached.
  252|  3.31M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  3.31M|        left_traversal_ = false;
  254|  3.31M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 92.7k, False: 481k]
  ------------------
  255|       |        // End reached.
  256|  92.7k|        corner_ = kInvalidCornerIndex;
  257|  92.7k|      }
  258|  3.88M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  28.5k|      corner_ = corner_table_->SwingRight(corner_);
  262|  28.5k|    }
  263|  3.91M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  3.40M|      : corner_table_(table),
  236|  3.40M|        start_corner_(corner_id),
  237|  3.40M|        corner_(start_corner_),
  238|  3.40M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   655k|      : corner_table_(table),
  236|   655k|        start_corner_(corner_id),
  237|   655k|        corner_(start_corner_),
  238|   655k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  84.8M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  84.8M|    return is_edge_on_seam_[corner.value()];
   47|  84.8M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  40.1M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  40.1M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 40.1M]
  |  Branch (50:42): [True: 36.1M, False: 3.98M]
  ------------------
   51|  36.1M|      return kInvalidCornerIndex;
   52|  36.1M|    }
   53|  3.98M|    return corner_table_->Opposite(corner);
   54|  40.1M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  57.6M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  57.6M|    return corner_table_->Next(corner);
   58|  57.6M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  33.0M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  33.0M|    return corner_table_->Previous(corner);
   62|  33.0M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  7.90M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  7.90M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  7.90M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  4.74M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  4.74M|    return Opposite(Previous(corner));
   73|  4.74M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  5.17M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  5.17M|    return Opposite(Next(corner));
   76|  5.17M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  6.58M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  6.58M|    return Previous(Opposite(Previous(corner)));
   81|  6.58M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  18.6M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  18.6M|    return Next(Opposite(Next(corner)));
   86|  18.6M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  16.0k|  int num_vertices() const {
   89|  16.0k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  16.0k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  5.24k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  2.32k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   151M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   151M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   151M|    return ConfidentVertex(corner);
   97|   151M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   151M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   151M|    return corner_to_vertex_map_[corner.value()];
  100|   151M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  4.72M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  4.72M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  4.72M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  4.72M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  4.72M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  4.72M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 4.72M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  4.72M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 4.28M, False: 437k]
  ------------------
  128|  4.28M|      return true;
  129|  4.28M|    }
  130|   437k|    return false;
  131|  4.72M|  }

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

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

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

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

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

_ZN5draco15MetadataDecoderC2Ev:
   23|  1.19k|MetadataDecoder::MetadataDecoder() : buffer_(nullptr) {}
_ZN5draco15MetadataDecoder22DecodeGeometryMetadataEPNS_13DecoderBufferEPNS_16GeometryMetadataE:
   35|  1.19k|                                             GeometryMetadata* metadata) {
   36|  1.19k|  if (!metadata) {
  ------------------
  |  Branch (36:7): [True: 0, False: 1.19k]
  ------------------
   37|      0|    return false;
   38|      0|  }
   39|  1.19k|  buffer_ = in_buffer;
   40|  1.19k|  uint32_t num_att_metadata = 0;
   41|  1.19k|  if (!DecodeVarint(&num_att_metadata, buffer_)) {
  ------------------
  |  Branch (41:7): [True: 26, False: 1.17k]
  ------------------
   42|     26|    return false;
   43|     26|  }
   44|       |  // Decode attribute metadata.
   45|  2.37k|  for (uint32_t i = 0; i < num_att_metadata; ++i) {
  ------------------
  |  Branch (45:24): [True: 1.90k, False: 469]
  ------------------
   46|  1.90k|    uint32_t att_unique_id;
   47|  1.90k|    if (!DecodeVarint(&att_unique_id, buffer_)) {
  ------------------
  |  Branch (47:9): [True: 51, False: 1.85k]
  ------------------
   48|     51|      return false;
   49|     51|    }
   50|  1.85k|    std::unique_ptr<AttributeMetadata> att_metadata =
   51|  1.85k|        std::unique_ptr<AttributeMetadata>(new AttributeMetadata());
   52|  1.85k|    att_metadata->set_att_unique_id(att_unique_id);
   53|  1.85k|    if (!DecodeMetadata(static_cast<Metadata*>(att_metadata.get()))) {
  ------------------
  |  Branch (53:9): [True: 653, False: 1.20k]
  ------------------
   54|    653|      return false;
   55|    653|    }
   56|  1.20k|    metadata->AddAttributeMetadata(std::move(att_metadata));
   57|  1.20k|  }
   58|    469|  return DecodeMetadata(static_cast<Metadata*>(metadata));
   59|  1.17k|}
_ZN5draco15MetadataDecoder14DecodeMetadataEPNS_8MetadataE:
   61|  2.32k|bool MetadataDecoder::DecodeMetadata(Metadata* metadata) {
   62|       |  // Limit metadata nesting depth to avoid stack overflow in destructor.
   63|  2.32k|  constexpr int kMaxSubmetadataLevel = 1000;
   64|       |
   65|  2.32k|  struct MetadataTuple {
   66|  2.32k|    Metadata* parent_metadata;
   67|  2.32k|    Metadata* decoded_metadata;
   68|  2.32k|    int level;
   69|  2.32k|  };
   70|  2.32k|  std::vector<MetadataTuple> metadata_stack;
   71|  2.32k|  metadata_stack.push_back({nullptr, metadata, 0});
   72|  58.2k|  while (!metadata_stack.empty()) {
  ------------------
  |  Branch (72:10): [True: 57.0k, False: 1.23k]
  ------------------
   73|  57.0k|    const MetadataTuple mp = metadata_stack.back();
   74|  57.0k|    metadata_stack.pop_back();
   75|  57.0k|    metadata = mp.decoded_metadata;
   76|       |
   77|  57.0k|    if (mp.parent_metadata != nullptr) {
  ------------------
  |  Branch (77:9): [True: 54.7k, False: 2.32k]
  ------------------
   78|  54.7k|      if (mp.level > kMaxSubmetadataLevel) {
  ------------------
  |  Branch (78:11): [True: 4, False: 54.7k]
  ------------------
   79|      4|        return false;
   80|      4|      }
   81|  54.7k|      std::string sub_metadata_name;
   82|  54.7k|      if (!DecodeName(&sub_metadata_name)) {
  ------------------
  |  Branch (82:11): [True: 52, False: 54.6k]
  ------------------
   83|     52|        return false;
   84|     52|      }
   85|  54.6k|      std::unique_ptr<Metadata> sub_metadata =
   86|  54.6k|          std::unique_ptr<Metadata>(new Metadata());
   87|  54.6k|      metadata = sub_metadata.get();
   88|  54.6k|      if (!mp.parent_metadata->AddSubMetadata(sub_metadata_name,
  ------------------
  |  Branch (88:11): [True: 23, False: 54.6k]
  ------------------
   89|  54.6k|                                              std::move(sub_metadata))) {
   90|     23|        return false;
   91|     23|      }
   92|  54.6k|    }
   93|  56.9k|    if (metadata == nullptr) {
  ------------------
  |  Branch (93:9): [True: 0, False: 56.9k]
  ------------------
   94|      0|      return false;
   95|      0|    }
   96|       |
   97|  56.9k|    uint32_t num_entries = 0;
   98|  56.9k|    if (!DecodeVarint(&num_entries, buffer_)) {
  ------------------
  |  Branch (98:9): [True: 80, False: 56.9k]
  ------------------
   99|     80|      return false;
  100|     80|    }
  101|   114k|    for (uint32_t i = 0; i < num_entries; ++i) {
  ------------------
  |  Branch (101:26): [True: 58.0k, False: 56.1k]
  ------------------
  102|  58.0k|      if (!DecodeEntry(metadata)) {
  ------------------
  |  Branch (102:11): [True: 781, False: 57.2k]
  ------------------
  103|    781|        return false;
  104|    781|      }
  105|  58.0k|    }
  106|  56.1k|    uint32_t num_sub_metadata = 0;
  107|  56.1k|    if (!DecodeVarint(&num_sub_metadata, buffer_)) {
  ------------------
  |  Branch (107:9): [True: 32, False: 56.0k]
  ------------------
  108|     32|      return false;
  109|     32|    }
  110|  56.0k|    if (num_sub_metadata > buffer_->remaining_size()) {
  ------------------
  |  Branch (110:9): [True: 118, False: 55.9k]
  ------------------
  111|       |      // The decoded number of metadata items is unreasonably high.
  112|    118|      return false;
  113|    118|    }
  114|   690k|    for (uint32_t i = 0; i < num_sub_metadata; ++i) {
  ------------------
  |  Branch (114:26): [True: 634k, False: 55.9k]
  ------------------
  115|   634k|      metadata_stack.push_back(
  116|   634k|          {metadata, nullptr, mp.parent_metadata ? mp.level + 1 : mp.level});
  ------------------
  |  Branch (116:31): [True: 625k, False: 8.69k]
  ------------------
  117|   634k|    }
  118|  55.9k|  }
  119|  1.23k|  return true;
  120|  2.32k|}
_ZN5draco15MetadataDecoder11DecodeEntryEPNS_8MetadataE:
  122|  58.0k|bool MetadataDecoder::DecodeEntry(Metadata* metadata) {
  123|  58.0k|  std::string entry_name;
  124|  58.0k|  if (!DecodeName(&entry_name)) {
  ------------------
  |  Branch (124:7): [True: 420, False: 57.6k]
  ------------------
  125|    420|    return false;
  126|    420|  }
  127|  57.6k|  uint32_t data_size = 0;
  128|  57.6k|  if (!DecodeVarint(&data_size, buffer_)) {
  ------------------
  |  Branch (128:7): [True: 97, False: 57.5k]
  ------------------
  129|     97|    return false;
  130|     97|  }
  131|  57.5k|  if (data_size == 0) {
  ------------------
  |  Branch (131:7): [True: 88, False: 57.4k]
  ------------------
  132|     88|    return false;
  133|     88|  }
  134|  57.4k|  if (data_size > buffer_->remaining_size()) {
  ------------------
  |  Branch (134:7): [True: 176, False: 57.2k]
  ------------------
  135|    176|    return false;
  136|    176|  }
  137|  57.2k|  std::vector<uint8_t> entry_value(data_size);
  138|  57.2k|  if (!buffer_->Decode(&entry_value[0], data_size)) {
  ------------------
  |  Branch (138:7): [True: 0, False: 57.2k]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|  57.2k|  metadata->AddEntryBinary(entry_name, entry_value);
  142|  57.2k|  return true;
  143|  57.2k|}
_ZN5draco15MetadataDecoder10DecodeNameEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  145|   112k|bool MetadataDecoder::DecodeName(std::string* name) {
  146|   112k|  uint8_t name_len = 0;
  147|   112k|  if (!buffer_->Decode(&name_len)) {
  ------------------
  |  Branch (147:7): [True: 169, False: 112k]
  ------------------
  148|    169|    return false;
  149|    169|  }
  150|   112k|  name->resize(name_len);
  151|   112k|  if (name_len == 0) {
  ------------------
  |  Branch (151:7): [True: 30.4k, False: 82.1k]
  ------------------
  152|  30.4k|    return true;
  153|  30.4k|  }
  154|  82.1k|  if (!buffer_->Decode(&name->at(0), name_len)) {
  ------------------
  |  Branch (154:7): [True: 303, False: 81.8k]
  ------------------
  155|    303|    return false;
  156|    303|  }
  157|  81.8k|  return true;
  158|  82.1k|}

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

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

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

