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

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

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

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

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

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

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

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

_ZNK5draco17GeometryAttribute10GetBytePosENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  118|  19.4M|  inline int64_t GetBytePos(AttributeValueIndex att_index) const {
  119|  19.4M|    return byte_offset_ + byte_stride_ * att_index.value();
  120|  19.4M|  }
_ZNK5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  122|  19.3M|  inline const uint8_t* GetAddress(AttributeValueIndex att_index) const {
  123|  19.3M|    const int64_t byte_pos = GetBytePos(att_index);
  124|  19.3M|    return buffer_->data() + byte_pos;
  125|  19.3M|  }
_ZN5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  126|  11.9k|  inline uint8_t* GetAddress(AttributeValueIndex att_index) {
  127|  11.9k|    const int64_t byte_pos = GetBytePos(att_index);
  128|  11.9k|    return buffer_->data() + byte_pos;
  129|  11.9k|  }
_ZNK5draco17GeometryAttribute14IsAddressValidEPKh:
  130|  58.1M|  inline bool IsAddressValid(const uint8_t* address) const {
  131|  58.1M|    return ((buffer_->data() + buffer_->data_size()) > address);
  132|  58.1M|  }
_ZNK5draco17GeometryAttribute8GetValueENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPv:
  136|  40.6M|  void GetValue(AttributeValueIndex att_index, void* out_data) const {
  137|  40.6M|    const int64_t byte_pos = byte_offset_ + byte_stride_ * att_index.value();
  138|  40.6M|    buffer_->Read(byte_pos, out_data, byte_stride_);
  139|  40.6M|  }
_ZN5draco17GeometryAttribute17SetAttributeValueENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPKv:
  143|   330M|  void SetAttributeValue(AttributeValueIndex entry_index, const void* value) {
  144|   330M|    const int64_t byte_pos = entry_index.value() * byte_stride();
  145|   330M|    buffer_->Write(byte_pos, value, byte_stride());
  146|   330M|  }
_ZNK5draco17GeometryAttribute14attribute_typeEv:
  266|  81.3k|  Type attribute_type() const { return attribute_type_; }
_ZNK5draco17GeometryAttribute9data_typeEv:
  269|  44.7k|  DataType data_type() const { return data_type_; }
_ZNK5draco17GeometryAttribute14num_componentsEv:
  273|  81.3M|  uint8_t num_components() const { return num_components_; }
_ZNK5draco17GeometryAttribute11byte_strideEv:
  282|   661M|  int64_t byte_stride() const { return byte_stride_; }
_ZNK5draco17GeometryAttribute9unique_idEv:
  287|  9.92k|  uint32_t unique_id() const { return unique_id_; }
_ZN5draco17GeometryAttribute13set_unique_idEj:
  288|   107k|  void set_unique_id(uint32_t id) { unique_id_ = id; }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  19.3M|  bool ConvertValue(AttributeValueIndex att_index, OutT* out_value) const {
  230|  19.3M|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  19.3M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  19.3M|                    OutT* out_val) const {
  180|  19.3M|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 19.3M]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  19.3M|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 19.3M]
  ------------------
  185|      0|        return ConvertTypedValue<int8_t, OutT>(att_id, out_num_components,
  186|      0|                                               out_val);
  187|      0|      case DT_UINT8:
  ------------------
  |  Branch (187:7): [True: 0, False: 19.3M]
  ------------------
  188|      0|        return ConvertTypedValue<uint8_t, OutT>(att_id, out_num_components,
  189|      0|                                                out_val);
  190|      0|      case DT_INT16:
  ------------------
  |  Branch (190:7): [True: 0, False: 19.3M]
  ------------------
  191|      0|        return ConvertTypedValue<int16_t, OutT>(att_id, out_num_components,
  192|      0|                                                out_val);
  193|      0|      case DT_UINT16:
  ------------------
  |  Branch (193:7): [True: 0, False: 19.3M]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  19.3M|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 19.3M, False: 0]
  ------------------
  197|  19.3M|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  19.3M|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 19.3M]
  ------------------
  200|      0|        return ConvertTypedValue<uint32_t, OutT>(att_id, out_num_components,
  201|      0|                                                 out_val);
  202|      0|      case DT_INT64:
  ------------------
  |  Branch (202:7): [True: 0, False: 19.3M]
  ------------------
  203|      0|        return ConvertTypedValue<int64_t, OutT>(att_id, out_num_components,
  204|      0|                                                out_val);
  205|      0|      case DT_UINT64:
  ------------------
  |  Branch (205:7): [True: 0, False: 19.3M]
  ------------------
  206|      0|        return ConvertTypedValue<uint64_t, OutT>(att_id, out_num_components,
  207|      0|                                                 out_val);
  208|      0|      case DT_FLOAT32:
  ------------------
  |  Branch (208:7): [True: 0, False: 19.3M]
  ------------------
  209|      0|        return ConvertTypedValue<float, OutT>(att_id, out_num_components,
  210|      0|                                              out_val);
  211|      0|      case DT_FLOAT64:
  ------------------
  |  Branch (211:7): [True: 0, False: 19.3M]
  ------------------
  212|      0|        return ConvertTypedValue<double, OutT>(att_id, out_num_components,
  213|      0|                                               out_val);
  214|      0|      case DT_BOOL:
  ------------------
  |  Branch (214:7): [True: 0, False: 19.3M]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 19.3M]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  19.3M|    }
  221|  19.3M|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIilEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  19.3M|                         OutT* out_value) const {
  307|  19.3M|    const uint8_t* src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|  77.4M|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 58.0M, False: 19.3M]
  ------------------
  311|  58.0M|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 58.0M]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  58.0M|      const T in_value = *reinterpret_cast<const T*>(src_address);
  315|  58.0M|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 58.0M]
  ------------------
  316|  58.0M|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  58.0M|      src_address += sizeof(T);
  320|  58.0M|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  19.3M|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 19.3M]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  19.3M|    return true;
  326|  19.3M|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIilEEbRKT_bPT0_:
  364|  58.0M|                                    OutT* out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  58.0M|#if __cplusplus >= 201703L
  367|  58.0M|    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.0M|#if __cplusplus >= 201703L
  374|       |      if constexpr (!std::is_same<T, bool>::value &&
  375|  58.0M|                    std::is_integral<T>::value) {
  376|       |#else
  377|       |      if (!std::is_same<T, bool>::value && std::is_integral<T>::value) {
  378|       |#endif
  379|  58.0M|        static constexpr OutT kOutMin =
  380|  58.0M|            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  ------------------
  |  Branch (380:13): [True: 0, Folded]
  ------------------
  381|  58.0M|        if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (381:13): [True: 0, False: 58.0M]
  |  Branch (381:35): [True: 0, False: 58.0M]
  ------------------
  382|      0|          return false;
  383|      0|        }
  384|  58.0M|      }
  385|       |
  386|       |      // Check conversion of floating point |in_value| to integral value OutT.
  387|  58.0M|#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.0M|    }
  419|       |
  420|  58.0M|    if (!normalized) {
  ------------------
  |  Branch (420:9): [True: 58.0M, False: 0]
  ------------------
  421|  58.0M|      *out_value = static_cast<OutT>(in_value);
  422|  58.0M|    } 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.0M|    return true;
  470|  58.0M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  31.2k|  bool ConvertValue(AttributeValueIndex att_index, OutT* out_value) const {
  230|  31.2k|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  31.2k|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  31.2k|                    OutT* out_val) const {
  180|  31.2k|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 31.2k]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  31.2k|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 31.2k]
  ------------------
  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: 31.2k]
  ------------------
  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: 31.2k]
  ------------------
  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: 31.2k]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  31.2k|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 31.2k, False: 0]
  ------------------
  197|  31.2k|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  31.2k|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 31.2k]
  ------------------
  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: 31.2k]
  ------------------
  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: 31.2k]
  ------------------
  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: 31.2k]
  ------------------
  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: 31.2k]
  ------------------
  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: 31.2k]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 31.2k]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  31.2k|    }
  221|  31.2k|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIifEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  31.2k|                         OutT* out_value) const {
  307|  31.2k|    const uint8_t* src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|   124k|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 93.6k, False: 31.2k]
  ------------------
  311|  93.6k|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 93.6k]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  93.6k|      const T in_value = *reinterpret_cast<const T*>(src_address);
  315|  93.6k|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 93.6k]
  ------------------
  316|  93.6k|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  93.6k|      src_address += sizeof(T);
  320|  93.6k|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  31.2k|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 31.2k]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  31.2k|    return true;
  326|  31.2k|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIifEEbRKT_bPT0_:
  364|  93.6k|                                    OutT* out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  93.6k|#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|  93.6k|    if (!normalized) {
  ------------------
  |  Branch (420:9): [True: 93.6k, False: 0]
  ------------------
  421|  93.6k|      *out_value = static_cast<OutT>(in_value);
  422|  93.6k|    } 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|  93.6k|    return true;
  470|  93.6k|  }

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

_ZNK5draco14PointAttribute4sizeEv:
   55|   330M|  size_t size() const { return num_unique_entries_; }
_ZNK5draco14PointAttribute12mapped_indexENS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   56|   347M|  AttributeValueIndex mapped_index(PointIndex point_index) const {
   57|   347M|    if (identity_mapping_) {
  ------------------
  |  Branch (57:9): [True: 289M, False: 57.9M]
  ------------------
   58|   289M|      return AttributeValueIndex(point_index.value());
   59|   289M|    }
   60|  57.9M|    return indices_map_[point_index];
   61|   347M|  }
_ZNK5draco14PointAttribute6bufferEv:
   62|  40.5M|  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|  14.7k|  void SetIdentityMapping() {
   89|  14.7k|    identity_mapping_ = true;
   90|  14.7k|    indices_map_.clear();
   91|  14.7k|  }
_ZN5draco14PointAttribute18SetExplicitMappingEm:
   94|  23.5k|  void SetExplicitMapping(size_t num_points) {
   95|  23.5k|    identity_mapping_ = false;
   96|  23.5k|    indices_map_.resize(num_points, kInvalidAttributeValueIndex);
   97|  23.5k|  }
_ZN5draco14PointAttribute16SetPointMapEntryENS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEE:
  101|   100M|                        AttributeValueIndex entry_index) {
  102|   100M|    DRACO_DCHECK(!identity_mapping_);
  103|   100M|    indices_map_[point_index] = entry_index;
  104|   100M|  }
_ZN5draco14PointAttribute25SetAttributeTransformDataENSt3__110unique_ptrINS_22AttributeTransformDataENS1_14default_deleteIS3_EEEE:
  129|    606|      std::unique_ptr<AttributeTransformData> transform_data) {
  130|    606|    attribute_transform_data_ = std::move(transform_data);
  131|    606|  }

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

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

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

_ZN5draco23KdTreeAttributesDecoderC2Ev:
  132|  11.2k|KdTreeAttributesDecoder::KdTreeAttributesDecoder() = default;
_ZN5draco23KdTreeAttributesDecoder24DecodePortableAttributesEPNS_13DecoderBufferE:
  135|  2.01k|    DecoderBuffer* in_buffer) {
  136|  2.01k|  if (in_buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 3)) {
  ------------------
  |  |  115|  2.01k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (136:7): [True: 1.10k, False: 908]
  ------------------
  137|       |    // Old bitstream does everything in the
  138|       |    // DecodeDataNeededByPortableTransforms() method.
  139|  1.10k|    return true;
  140|  1.10k|  }
  141|    908|  uint8_t compression_level = 0;
  142|    908|  if (!in_buffer->Decode(&compression_level)) {
  ------------------
  |  Branch (142:7): [True: 2, False: 906]
  ------------------
  143|      2|    return false;
  144|      2|  }
  145|    906|  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|    906|  const int num_attributes = GetNumAttributes();
  153|    906|  uint32_t total_dimensionality = 0;  // position is a required dimension
  154|    906|  std::vector<AttributeTuple> atts(num_attributes);
  155|       |
  156|  2.98k|  for (int i = 0; i < GetNumAttributes(); ++i) {
  ------------------
  |  Branch (156:19): [True: 2.08k, False: 903]
  ------------------
  157|  2.08k|    const int att_id = GetAttributeId(i);
  158|  2.08k|    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.08k|    att->Reset(num_points);
  162|  2.08k|    att->SetIdentityMapping();
  163|       |
  164|  2.08k|    PointAttribute* target_att = nullptr;
  165|  2.08k|    if (att->data_type() == DT_UINT32 || att->data_type() == DT_UINT16 ||
  ------------------
  |  Branch (165:9): [True: 35, False: 2.04k]
  |  Branch (165:42): [True: 376, False: 1.67k]
  ------------------
  166|  1.67k|        att->data_type() == DT_UINT8) {
  ------------------
  |  Branch (166:9): [True: 230, False: 1.44k]
  ------------------
  167|       |      // We can decode to these attributes directly.
  168|    641|      target_att = att;
  169|  1.44k|    } else if (att->data_type() == DT_INT32 || att->data_type() == DT_INT16 ||
  ------------------
  |  Branch (169:16): [True: 217, False: 1.22k]
  |  Branch (169:48): [True: 186, False: 1.04k]
  ------------------
  170|  1.09k|               att->data_type() == DT_INT8) {
  ------------------
  |  Branch (170:16): [True: 688, False: 352]
  ------------------
  171|       |      // Prepare storage for data that is used to convert unsigned values back
  172|       |      // to the signed ones.
  173|  35.5k|      for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (173:23): [True: 34.5k, False: 1.09k]
  ------------------
  174|  34.5k|        min_signed_values_.push_back(0);
  175|  34.5k|      }
  176|  1.09k|      target_att = att;
  177|  1.09k|    } else if (att->data_type() == DT_FLOAT32) {
  ------------------
  |  Branch (177:16): [True: 349, False: 3]
  ------------------
  178|       |      // Create a portable attribute that will hold the decoded data. We will
  179|       |      // dequantize the decoded data to the final attribute later on.
  180|    349|      const int num_components = att->num_components();
  181|    349|      GeometryAttribute va;
  182|    349|      va.Init(att->attribute_type(), nullptr, num_components, DT_UINT32, false,
  183|    349|              num_components * DataTypeLength(DT_UINT32), 0);
  184|    349|      std::unique_ptr<PointAttribute> port_att(new PointAttribute(va));
  185|    349|      port_att->SetIdentityMapping();
  186|    349|      port_att->Reset(num_points);
  187|    349|      quantized_portable_attributes_.push_back(std::move(port_att));
  188|    349|      target_att = quantized_portable_attributes_.back().get();
  189|    349|    } else {
  190|       |      // Unsupported type.
  191|      3|      return false;
  192|      3|    }
  193|       |    // Add attribute to the output iterator used by the core algorithm.
  194|  2.08k|    const DataType data_type = target_att->data_type();
  195|  2.08k|    const uint32_t data_size = (std::max)(0, DataTypeLength(data_type));
  196|  2.08k|    const uint32_t num_components = target_att->num_components();
  197|  2.08k|    atts[i] = std::make_tuple(target_att, total_dimensionality, data_type,
  198|  2.08k|                              data_size, num_components);
  199|  2.08k|    total_dimensionality += num_components;
  200|  2.08k|  }
  201|    903|  typedef PointAttributeVectorOutputIterator<uint32_t> OutIt;
  202|    903|  OutIt out_it(atts);
  203|       |
  204|    903|  switch (compression_level) {
  205|    124|    case 0: {
  ------------------
  |  Branch (205:5): [True: 124, False: 779]
  ------------------
  206|    124|      if (!DecodePoints<0, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (206:11): [True: 52, False: 72]
  ------------------
  207|    124|                                  &out_it)) {
  208|     52|        return false;
  209|     52|      }
  210|     72|      break;
  211|    124|    }
  212|     72|    case 1: {
  ------------------
  |  Branch (212:5): [True: 68, False: 835]
  ------------------
  213|     68|      if (!DecodePoints<1, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (213:11): [True: 32, False: 36]
  ------------------
  214|     68|                                  &out_it)) {
  215|     32|        return false;
  216|     32|      }
  217|     36|      break;
  218|     68|    }
  219|     68|    case 2: {
  ------------------
  |  Branch (219:5): [True: 68, False: 835]
  ------------------
  220|     68|      if (!DecodePoints<2, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (220:11): [True: 55, False: 13]
  ------------------
  221|     68|                                  &out_it)) {
  222|     55|        return false;
  223|     55|      }
  224|     13|      break;
  225|     68|    }
  226|     64|    case 3: {
  ------------------
  |  Branch (226:5): [True: 64, False: 839]
  ------------------
  227|     64|      if (!DecodePoints<3, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (227:11): [True: 48, False: 16]
  ------------------
  228|     64|                                  &out_it)) {
  229|     48|        return false;
  230|     48|      }
  231|     16|      break;
  232|     64|    }
  233|    187|    case 4: {
  ------------------
  |  Branch (233:5): [True: 187, False: 716]
  ------------------
  234|    187|      if (!DecodePoints<4, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (234:11): [True: 168, False: 19]
  ------------------
  235|    187|                                  &out_it)) {
  236|    168|        return false;
  237|    168|      }
  238|     19|      break;
  239|    187|    }
  240|    185|    case 5: {
  ------------------
  |  Branch (240:5): [True: 185, False: 718]
  ------------------
  241|    185|      if (!DecodePoints<5, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (241:11): [True: 149, False: 36]
  ------------------
  242|    185|                                  &out_it)) {
  243|    149|        return false;
  244|    149|      }
  245|     36|      break;
  246|    185|    }
  247|    201|    case 6: {
  ------------------
  |  Branch (247:5): [True: 201, False: 702]
  ------------------
  248|    201|      if (!DecodePoints<6, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (248:11): [True: 130, False: 71]
  ------------------
  249|    201|                                  &out_it)) {
  250|    130|        return false;
  251|    130|      }
  252|     71|      break;
  253|    201|    }
  254|     71|    default:
  ------------------
  |  Branch (254:5): [True: 6, False: 897]
  ------------------
  255|      6|      return false;
  256|    903|  }
  257|    263|  return true;
  258|    903|}
_ZN5draco23KdTreeAttributesDecoder36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
  274|  1.36k|    DecoderBuffer* in_buffer) {
  275|  1.36k|  if (in_buffer->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 3)) {
  ------------------
  |  |  115|  1.36k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (275:7): [True: 263, False: 1.10k]
  ------------------
  276|       |    // Decode quantization data for each attribute that need it.
  277|       |    // TODO(ostava): This should be moved to AttributeQuantizationTransform.
  278|    263|    std::vector<float> min_value;
  279|  1.04k|    for (int i = 0; i < GetNumAttributes(); ++i) {
  ------------------
  |  Branch (279:21): [True: 815, False: 227]
  ------------------
  280|    815|      const int att_id = GetAttributeId(i);
  281|    815|      const PointAttribute* const att =
  282|    815|          GetDecoder()->point_cloud()->attribute(att_id);
  283|    815|      if (att->data_type() == DT_FLOAT32) {
  ------------------
  |  Branch (283:11): [True: 188, False: 627]
  ------------------
  284|    188|        const int num_components = att->num_components();
  285|    188|        min_value.resize(num_components);
  286|    188|        if (!in_buffer->Decode(&min_value[0], sizeof(float) * num_components)) {
  ------------------
  |  Branch (286:13): [True: 20, False: 168]
  ------------------
  287|     20|          return false;
  288|     20|        }
  289|    168|        float max_value_dif;
  290|    168|        if (!in_buffer->Decode(&max_value_dif)) {
  ------------------
  |  Branch (290:13): [True: 3, False: 165]
  ------------------
  291|      3|          return false;
  292|      3|        }
  293|    165|        uint8_t quantization_bits;
  294|    165|        if (!in_buffer->Decode(&quantization_bits) || quantization_bits > 31) {
  ------------------
  |  Branch (294:13): [True: 1, False: 164]
  |  Branch (294:55): [True: 8, False: 156]
  ------------------
  295|      9|          return false;
  296|      9|        }
  297|    156|        AttributeQuantizationTransform transform;
  298|    156|        if (!transform.SetParameters(quantization_bits, min_value.data(),
  ------------------
  |  Branch (298:13): [True: 4, False: 152]
  ------------------
  299|    156|                                     num_components, max_value_dif)) {
  300|      4|          return false;
  301|      4|        }
  302|    152|        const int num_transforms =
  303|    152|            static_cast<int>(attribute_quantization_transforms_.size());
  304|    152|        if (!transform.TransferToAttribute(
  ------------------
  |  Branch (304:13): [True: 0, False: 152]
  ------------------
  305|    152|                quantized_portable_attributes_[num_transforms].get())) {
  306|      0|          return false;
  307|      0|        }
  308|    152|        attribute_quantization_transforms_.push_back(transform);
  309|    152|      }
  310|    815|    }
  311|       |
  312|       |    // Decode transform data for signed integer attributes.
  313|  8.08k|    for (int i = 0; i < min_signed_values_.size(); ++i) {
  ------------------
  |  Branch (313:21): [True: 7.92k, False: 164]
  ------------------
  314|  7.92k|      int32_t val;
  315|  7.92k|      if (!DecodeVarint(&val, in_buffer)) {
  ------------------
  |  Branch (315:11): [True: 63, False: 7.85k]
  ------------------
  316|     63|        return false;
  317|     63|      }
  318|  7.85k|      min_signed_values_[i] = val;
  319|  7.85k|    }
  320|    164|    return true;
  321|    227|  }
  322|  1.10k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  323|       |  // Handle old bitstream
  324|       |  // Figure out the total dimensionality of the point cloud
  325|  1.10k|  const uint32_t attribute_count = GetNumAttributes();
  326|  1.10k|  uint32_t total_dimensionality = 0;  // position is a required dimension
  327|  1.10k|  std::vector<AttributeTuple> atts(attribute_count);
  328|  1.10k|  for (auto attribute_index = 0;
  329|  2.45k|       static_cast<uint32_t>(attribute_index) < attribute_count;
  ------------------
  |  Branch (329:8): [True: 1.34k, False: 1.10k]
  ------------------
  330|  1.34k|       attribute_index += 1)  // increment the dimensionality as needed...
  331|  1.34k|  {
  332|  1.34k|    const int att_id = GetAttributeId(attribute_index);
  333|  1.34k|    PointAttribute* const att = GetDecoder()->point_cloud()->attribute(att_id);
  334|  1.34k|    const DataType data_type = att->data_type();
  335|  1.34k|    const uint32_t data_size = (std::max)(0, DataTypeLength(data_type));
  336|  1.34k|    const uint32_t num_components = att->num_components();
  337|  1.34k|    if (data_size > 4) {
  ------------------
  |  Branch (337:9): [True: 0, False: 1.34k]
  ------------------
  338|      0|      return false;
  339|      0|    }
  340|       |
  341|  1.34k|    atts[attribute_index] = std::make_tuple(
  342|  1.34k|        att, total_dimensionality, data_type, data_size, num_components);
  343|       |    // everything is treated as 32bit in the encoder.
  344|  1.34k|    total_dimensionality += num_components;
  345|  1.34k|  }
  346|       |
  347|  1.10k|  const int att_id = GetAttributeId(0);
  348|  1.10k|  PointAttribute* const att = GetDecoder()->point_cloud()->attribute(att_id);
  349|  1.10k|  att->SetIdentityMapping();
  350|       |  // Decode method
  351|  1.10k|  uint8_t method;
  352|  1.10k|  if (!in_buffer->Decode(&method)) {
  ------------------
  |  Branch (352:7): [True: 1, False: 1.10k]
  ------------------
  353|      1|    return false;
  354|      1|  }
  355|  1.10k|  if (method == KdTreeAttributesEncodingMethod::kKdTreeQuantizationEncoding) {
  ------------------
  |  Branch (355:7): [True: 740, False: 361]
  ------------------
  356|       |    // This method only supports one attribute with exactly three components.
  357|    740|    if (atts.size() != 1 || std::get<4>(atts[0]) != 3) {
  ------------------
  |  Branch (357:9): [True: 1, False: 739]
  |  Branch (357:29): [True: 3, False: 736]
  ------------------
  358|      4|      return false;
  359|      4|    }
  360|    736|    uint8_t compression_level = 0;
  361|    736|    if (!in_buffer->Decode(&compression_level)) {
  ------------------
  |  Branch (361:9): [True: 0, False: 736]
  ------------------
  362|      0|      return false;
  363|      0|    }
  364|    736|    uint32_t num_points = 0;
  365|    736|    if (!in_buffer->Decode(&num_points)) {
  ------------------
  |  Branch (365:9): [True: 0, False: 736]
  ------------------
  366|      0|      return false;
  367|      0|    }
  368|    736|    att->Reset(num_points);
  369|    736|    FloatPointsTreeDecoder decoder;
  370|    736|    decoder.set_num_points_from_header(num_points);
  371|    736|    PointAttributeVectorOutputIterator<float> out_it(atts);
  372|    736|    if (!decoder.DecodePointCloud(in_buffer, out_it)) {
  ------------------
  |  Branch (372:9): [True: 722, False: 14]
  ------------------
  373|    722|      return false;
  374|    722|    }
  375|    736|  } else if (method == KdTreeAttributesEncodingMethod::kKdTreeIntegerEncoding) {
  ------------------
  |  Branch (375:14): [True: 350, False: 11]
  ------------------
  376|    350|    uint8_t compression_level = 0;
  377|    350|    if (!in_buffer->Decode(&compression_level)) {
  ------------------
  |  Branch (377:9): [True: 0, False: 350]
  ------------------
  378|      0|      return false;
  379|      0|    }
  380|    350|    if (6 < compression_level) {
  ------------------
  |  Branch (380:9): [True: 0, False: 350]
  ------------------
  381|      0|      DRACO_LOGE(
  ------------------
  |  |   31|      0|#define DRACO_LOGE printf
  ------------------
  382|      0|          "KdTreeAttributesDecoder: compression level %i not supported.\n",
  383|      0|          compression_level);
  384|      0|      return false;
  385|      0|    }
  386|       |
  387|    350|    uint32_t num_points;
  388|    350|    if (!in_buffer->Decode(&num_points)) {
  ------------------
  |  Branch (388:9): [True: 1, False: 349]
  ------------------
  389|      1|      return false;
  390|      1|    }
  391|       |
  392|    349|    for (auto attribute_index = 0;
  393|    833|         static_cast<uint32_t>(attribute_index) < attribute_count;
  ------------------
  |  Branch (393:10): [True: 484, False: 349]
  ------------------
  394|    484|         attribute_index += 1) {
  395|    484|      const int att_id = GetAttributeId(attribute_index);
  396|    484|      PointAttribute* const attr =
  397|    484|          GetDecoder()->point_cloud()->attribute(att_id);
  398|    484|      attr->Reset(num_points);
  399|    484|      attr->SetIdentityMapping();
  400|    484|    }
  401|       |
  402|    349|    using OutIt = PointAttributeVectorOutputIterator<uint32_t>;
  403|    349|    OutIt out_it(atts);
  404|       |
  405|    349|    switch (compression_level) {
  406|    106|      case 0: {
  ------------------
  |  Branch (406:7): [True: 106, False: 243]
  ------------------
  407|    106|        if (!DecodePoints<0, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (407:13): [True: 105, False: 1]
  ------------------
  408|    106|                                    &out_it)) {
  409|    105|          return false;
  410|    105|        }
  411|      1|        break;
  412|    106|      }
  413|    123|      case 1: {
  ------------------
  |  Branch (413:7): [True: 123, False: 226]
  ------------------
  414|    123|        if (!DecodePoints<1, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (414:13): [True: 122, False: 1]
  ------------------
  415|    123|                                    &out_it)) {
  416|    122|          return false;
  417|    122|        }
  418|      1|        break;
  419|    123|      }
  420|     72|      case 2: {
  ------------------
  |  Branch (420:7): [True: 72, False: 277]
  ------------------
  421|     72|        if (!DecodePoints<2, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (421:13): [True: 71, False: 1]
  ------------------
  422|     72|                                    &out_it)) {
  423|     71|          return false;
  424|     71|        }
  425|      1|        break;
  426|     72|      }
  427|     43|      case 3: {
  ------------------
  |  Branch (427:7): [True: 43, False: 306]
  ------------------
  428|     43|        if (!DecodePoints<3, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (428:13): [True: 42, False: 1]
  ------------------
  429|     43|                                    &out_it)) {
  430|     42|          return false;
  431|     42|        }
  432|      1|        break;
  433|     43|      }
  434|      4|      case 4: {
  ------------------
  |  Branch (434:7): [True: 4, False: 345]
  ------------------
  435|      4|        if (!DecodePoints<4, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (435:13): [True: 4, False: 0]
  ------------------
  436|      4|                                    &out_it)) {
  437|      4|          return false;
  438|      4|        }
  439|      0|        break;
  440|      4|      }
  441|      0|      case 5: {
  ------------------
  |  Branch (441:7): [True: 0, False: 349]
  ------------------
  442|      0|        if (!DecodePoints<5, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (442:13): [True: 0, False: 0]
  ------------------
  443|      0|                                    &out_it)) {
  444|      0|          return false;
  445|      0|        }
  446|      0|        break;
  447|      0|      }
  448|      1|      case 6: {
  ------------------
  |  Branch (448:7): [True: 1, False: 348]
  ------------------
  449|      1|        if (!DecodePoints<6, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (449:13): [True: 1, False: 0]
  ------------------
  450|      1|                                    &out_it)) {
  451|      1|          return false;
  452|      1|        }
  453|      0|        break;
  454|      1|      }
  455|      0|      default:
  ------------------
  |  Branch (455:7): [True: 0, False: 349]
  ------------------
  456|      0|        return false;
  457|    349|    }
  458|    349|  } else {
  459|       |    // Invalid method.
  460|     11|    return false;
  461|     11|  }
  462|     18|  return true;
  463|       |#else
  464|       |  return false;
  465|       |#endif
  466|  1.10k|}
_ZN5draco23KdTreeAttributesDecoder35TransformAttributesToOriginalFormatEv:
  494|    182|bool KdTreeAttributesDecoder::TransformAttributesToOriginalFormat() {
  495|    182|  if (quantized_portable_attributes_.empty() && min_signed_values_.empty()) {
  ------------------
  |  Branch (495:7): [True: 146, False: 36]
  |  Branch (495:49): [True: 52, False: 94]
  ------------------
  496|     52|    return true;
  497|     52|  }
  498|    130|  int num_processed_quantized_attributes = 0;
  499|    130|  int num_processed_signed_components = 0;
  500|       |  // Dequantize attributes that needed it.
  501|    553|  for (int i = 0; i < GetNumAttributes(); ++i) {
  ------------------
  |  Branch (501:19): [True: 423, False: 130]
  ------------------
  502|    423|    const int att_id = GetAttributeId(i);
  503|    423|    PointAttribute* const att = GetDecoder()->point_cloud()->attribute(att_id);
  504|    423|    if (att->data_type() == DT_INT32 || att->data_type() == DT_INT16 ||
  ------------------
  |  Branch (504:9): [True: 57, False: 366]
  |  Branch (504:41): [True: 85, False: 281]
  ------------------
  505|    281|        att->data_type() == DT_INT8) {
  ------------------
  |  Branch (505:9): [True: 70, False: 211]
  ------------------
  506|    212|      std::vector<uint32_t> unsigned_val(att->num_components());
  507|    212|      std::vector<int32_t> signed_val(att->num_components());
  508|       |      // Values are stored as unsigned in the attribute, make them signed again.
  509|    212|      if (att->data_type() == DT_INT32) {
  ------------------
  |  Branch (509:11): [True: 57, False: 155]
  ------------------
  510|     57|        if (!TransformAttributeBackToSignedType<int32_t>(
  ------------------
  |  Branch (510:13): [True: 0, False: 57]
  ------------------
  511|     57|                att, num_processed_signed_components)) {
  512|      0|          return false;
  513|      0|        }
  514|    155|      } else if (att->data_type() == DT_INT16) {
  ------------------
  |  Branch (514:18): [True: 85, False: 70]
  ------------------
  515|     85|        if (!TransformAttributeBackToSignedType<int16_t>(
  ------------------
  |  Branch (515:13): [True: 0, False: 85]
  ------------------
  516|     85|                att, num_processed_signed_components)) {
  517|      0|          return false;
  518|      0|        }
  519|     85|      } else if (att->data_type() == DT_INT8) {
  ------------------
  |  Branch (519:18): [True: 70, False: 0]
  ------------------
  520|     70|        if (!TransformAttributeBackToSignedType<int8_t>(
  ------------------
  |  Branch (520:13): [True: 0, False: 70]
  ------------------
  521|     70|                att, num_processed_signed_components)) {
  522|      0|          return false;
  523|      0|        }
  524|     70|      }
  525|    212|      num_processed_signed_components += att->num_components();
  526|    212|    } else if (att->data_type() == DT_FLOAT32) {
  ------------------
  |  Branch (526:16): [True: 85, False: 126]
  ------------------
  527|       |      // TODO(ostava): This code should be probably moved out to attribute
  528|       |      // transform and shared with the SequentialQuantizationAttributeDecoder.
  529|       |
  530|     85|      const PointAttribute* const src_att =
  531|     85|          quantized_portable_attributes_[num_processed_quantized_attributes]
  532|     85|              .get();
  533|       |
  534|     85|      const AttributeQuantizationTransform& transform =
  535|     85|          attribute_quantization_transforms_
  536|     85|              [num_processed_quantized_attributes];
  537|       |
  538|     85|      num_processed_quantized_attributes++;
  539|       |
  540|     85|      if (GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (540:11): [True: 35, False: 50]
  ------------------
  541|     85|              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|     50|      const int32_t max_quantized_value =
  553|     50|          (1u << static_cast<uint32_t>(transform.quantization_bits())) - 1;
  554|     50|      const int num_components = att->num_components();
  555|     50|      const int entry_size = sizeof(float) * num_components;
  556|     50|      const std::unique_ptr<float[]> att_val(new float[num_components]);
  557|     50|      int quant_val_id = 0;
  558|     50|      int out_byte_pos = 0;
  559|     50|      Dequantizer dequantizer;
  560|     50|      if (!dequantizer.Init(transform.range(), max_quantized_value)) {
  ------------------
  |  Branch (560:11): [True: 0, False: 50]
  ------------------
  561|      0|        return false;
  562|      0|      }
  563|     50|      const uint32_t* const portable_attribute_data =
  564|     50|          reinterpret_cast<const uint32_t*>(
  565|     50|              src_att->GetAddress(AttributeValueIndex(0)));
  566|     50|      for (uint32_t i = 0; i < src_att->size(); ++i) {
  ------------------
  |  Branch (566:28): [True: 0, False: 50]
  ------------------
  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|     50|    }
  578|    423|  }
  579|    130|  return true;
  580|    130|}
_ZN5draco34PointAttributeVectorOutputIteratorIjEC2ERKNSt3__16vectorINS2_5tupleIJPNS_14PointAttributeEjNS_8DataTypeEjjEEENS2_9allocatorIS8_EEEE:
   48|  1.25k|      : attributes_(atts), point_id_(0) {
   49|  1.25k|    DRACO_DCHECK_GE(atts.size(), 1);
   50|  1.25k|    uint32_t required_decode_bytes = 0;
   51|  3.81k|    for (auto index = 0; index < attributes_.size(); index++) {
  ------------------
  |  Branch (51:26): [True: 2.55k, False: 1.25k]
  ------------------
   52|  2.55k|      const AttributeTuple& att = attributes_[index];
   53|  2.55k|      required_decode_bytes = (std::max)(required_decode_bytes,
   54|  2.55k|                                         std::get<3>(att) * std::get<4>(att));
   55|  2.55k|    }
   56|  1.25k|    memory_.resize(required_decode_bytes);
   57|  1.25k|    data_ = memory_.data();
   58|  1.25k|  }
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi0ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    230|                                           OutIteratorT* out_iterator) {
  265|    230|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    230|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 138, False: 92]
  ------------------
  267|    157|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 19, False: 73]
  ------------------
  268|    157|    return false;
  269|    157|  }
  270|     73|  return true;
  271|    230|}
_ZN5draco34PointAttributeVectorOutputIteratorIjEdeEv:
   73|   289M|  Self& operator*() { return *this; }
_ZN5draco34PointAttributeVectorOutputIteratorIjEaSERKNSt3__16vectorIjNS2_9allocatorIjEEEE:
   91|   289M|  const Self& operator=(const std::vector<CoeffT>& val) {
   92|   578M|    for (auto index = 0; index < attributes_.size(); index++) {
  ------------------
  |  Branch (92:26): [True: 289M, False: 289M]
  ------------------
   93|   289M|      AttributeTuple& att = attributes_[index];
   94|   289M|      PointAttribute* attribute = std::get<0>(att);
   95|   289M|      const AttributeValueIndex avi = attribute->mapped_index(point_id_);
   96|   289M|      if (avi >= static_cast<uint32_t>(attribute->size())) {
  ------------------
  |  Branch (96:11): [True: 0, False: 289M]
  ------------------
   97|      0|        return *this;
   98|      0|      }
   99|   289M|      const uint32_t& offset = std::get<1>(att);
  100|   289M|      const uint32_t& data_size = std::get<3>(att);
  101|   289M|      const uint32_t& num_components = std::get<4>(att);
  102|   289M|      const uint32_t* data_source = val.data() + offset;
  103|   289M|      if (data_size < 4) {  // handle uint16_t, uint8_t
  ------------------
  |  Branch (103:11): [True: 217M, False: 72.1M]
  ------------------
  104|       |        // selectively copy data bytes
  105|   217M|        uint8_t* data_counter = data_;
  106|  1.26G|        for (uint32_t index = 0; index < num_components;
  ------------------
  |  Branch (106:34): [True: 1.04G, False: 217M]
  ------------------
  107|  1.04G|             index += 1, data_counter += data_size) {
  108|  1.04G|          std::memcpy(data_counter, data_source + index, data_size);
  109|  1.04G|        }
  110|       |        // redirect to copied data
  111|   217M|        data_source = reinterpret_cast<uint32_t*>(data_);
  112|   217M|      }
  113|   289M|      attribute->SetAttributeValue(avi, data_source);
  114|   289M|    }
  115|   289M|    return *this;
  116|   289M|  }
_ZN5draco34PointAttributeVectorOutputIteratorIjEppEv:
   60|   289M|  const Self& operator++() {
   61|   289M|    ++point_id_;
   62|   289M|    return *this;
   63|   289M|  }
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi1ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    191|                                           OutIteratorT* out_iterator) {
  265|    191|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    191|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 130, False: 61]
  ------------------
  267|    154|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 24, False: 37]
  ------------------
  268|    154|    return false;
  269|    154|  }
  270|     37|  return true;
  271|    191|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi2ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    140|                                           OutIteratorT* out_iterator) {
  265|    140|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    140|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 114, False: 26]
  ------------------
  267|    126|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 12, False: 14]
  ------------------
  268|    126|    return false;
  269|    126|  }
  270|     14|  return true;
  271|    140|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi3ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    107|                                           OutIteratorT* out_iterator) {
  265|    107|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    107|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 86, False: 21]
  ------------------
  267|     90|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 4, False: 17]
  ------------------
  268|     90|    return false;
  269|     90|  }
  270|     17|  return true;
  271|    107|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi4ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    191|                                           OutIteratorT* out_iterator) {
  265|    191|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    191|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 98, False: 93]
  ------------------
  267|    172|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 74, False: 19]
  ------------------
  268|    172|    return false;
  269|    172|  }
  270|     19|  return true;
  271|    191|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi5ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    185|                                           OutIteratorT* out_iterator) {
  265|    185|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    185|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 134, False: 51]
  ------------------
  267|    149|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 15, False: 36]
  ------------------
  268|    149|    return false;
  269|    149|  }
  270|     36|  return true;
  271|    185|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi6ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    202|                                           OutIteratorT* out_iterator) {
  265|    202|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    202|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 130, False: 72]
  ------------------
  267|    131|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 1, False: 71]
  ------------------
  268|    131|    return false;
  269|    131|  }
  270|     71|  return true;
  271|    202|}
_ZN5draco34PointAttributeVectorOutputIteratorIfEC2ERKNSt3__16vectorINS2_5tupleIJPNS_14PointAttributeEjNS_8DataTypeEjjEEENS2_9allocatorIS8_EEEE:
   48|    736|      : attributes_(atts), point_id_(0) {
   49|    736|    DRACO_DCHECK_GE(atts.size(), 1);
   50|    736|    uint32_t required_decode_bytes = 0;
   51|  1.47k|    for (auto index = 0; index < attributes_.size(); index++) {
  ------------------
  |  Branch (51:26): [True: 736, False: 736]
  ------------------
   52|    736|      const AttributeTuple& att = attributes_[index];
   53|    736|      required_decode_bytes = (std::max)(required_decode_bytes,
   54|    736|                                         std::get<3>(att) * std::get<4>(att));
   55|    736|    }
   56|    736|    memory_.resize(required_decode_bytes);
   57|    736|    data_ = memory_.data();
   58|    736|  }
_ZN5draco34PointAttributeVectorOutputIteratorIfEdeEv:
   73|     85|  Self& operator*() { return *this; }
_ZN5draco34PointAttributeVectorOutputIteratorIfEaSERKNS_7VectorDIfLi3EEE:
   77|     85|  const Self& operator=(const VectorD<CoeffT, 3>& val) {
   78|     85|    DRACO_DCHECK_EQ(attributes_.size(), 1);  // Expect only ONE attribute.
   79|     85|    AttributeTuple& att = attributes_[0];
   80|     85|    PointAttribute* attribute = std::get<0>(att);
   81|     85|    const AttributeValueIndex avi = attribute->mapped_index(point_id_);
   82|     85|    if (avi >= static_cast<uint32_t>(attribute->size())) {
  ------------------
  |  Branch (82:9): [True: 80, False: 5]
  ------------------
   83|     80|      return *this;
   84|     80|    }
   85|      5|    const uint32_t& offset = std::get<1>(att);
   86|      5|    DRACO_DCHECK_EQ(offset, 0);  // expected to be zero
   87|      5|    attribute->SetAttributeValue(avi, &val[0] + offset);
   88|      5|    return *this;
   89|     85|  }
_ZN5draco34PointAttributeVectorOutputIteratorIfEppEv:
   60|     85|  const Self& operator++() {
   61|     85|    ++point_id_;
   62|     85|    return *this;
   63|     85|  }
_ZN5draco23KdTreeAttributesDecoder34TransformAttributeBackToSignedTypeIiEEbPNS_14PointAttributeEi:
  470|     57|    PointAttribute* att, int num_processed_signed_components) {
  471|     57|  typedef typename std::make_unsigned<SignedDataTypeT>::type UnsignedType;
  472|     57|  std::vector<UnsignedType> unsigned_val(att->num_components());
  473|     57|  std::vector<SignedDataTypeT> signed_val(att->num_components());
  474|       |
  475|    193|  for (AttributeValueIndex avi(0); avi < static_cast<uint32_t>(att->size());
  ------------------
  |  Branch (475:36): [True: 136, False: 57]
  ------------------
  476|    136|       ++avi) {
  477|    136|    att->GetValue(avi, &unsigned_val[0]);
  478|  11.6k|    for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (478:21): [True: 11.5k, False: 136]
  ------------------
  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|  11.5k|      if (unsigned_val[c] > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (482:11): [True: 0, False: 11.5k]
  ------------------
  483|      0|        return false;
  484|      0|      }
  485|  11.5k|      signed_val[c] = static_cast<SignedDataTypeT>(
  486|  11.5k|          static_cast<int32_t>(unsigned_val[c]) +
  487|  11.5k|          min_signed_values_[num_processed_signed_components + c]);
  488|  11.5k|    }
  489|    136|    att->SetAttributeValue(avi, &signed_val[0]);
  490|    136|  }
  491|     57|  return true;
  492|     57|}
_ZN5draco23KdTreeAttributesDecoder34TransformAttributeBackToSignedTypeIsEEbPNS_14PointAttributeEi:
  470|     85|    PointAttribute* att, int num_processed_signed_components) {
  471|     85|  typedef typename std::make_unsigned<SignedDataTypeT>::type UnsignedType;
  472|     85|  std::vector<UnsignedType> unsigned_val(att->num_components());
  473|     85|  std::vector<SignedDataTypeT> signed_val(att->num_components());
  474|       |
  475|     85|  for (AttributeValueIndex avi(0); avi < static_cast<uint32_t>(att->size());
  ------------------
  |  Branch (475:36): [True: 0, False: 85]
  ------------------
  476|     85|       ++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|     85|  return true;
  492|     85|}
_ZN5draco23KdTreeAttributesDecoder34TransformAttributeBackToSignedTypeIaEEbPNS_14PointAttributeEi:
  470|     70|    PointAttribute* att, int num_processed_signed_components) {
  471|     70|  typedef typename std::make_unsigned<SignedDataTypeT>::type UnsignedType;
  472|     70|  std::vector<UnsignedType> unsigned_val(att->num_components());
  473|     70|  std::vector<SignedDataTypeT> signed_val(att->num_components());
  474|       |
  475|  40.6M|  for (AttributeValueIndex avi(0); avi < static_cast<uint32_t>(att->size());
  ------------------
  |  Branch (475:36): [True: 40.6M, False: 70]
  ------------------
  476|  40.6M|       ++avi) {
  477|  40.6M|    att->GetValue(avi, &unsigned_val[0]);
  478|  81.2M|    for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (478:21): [True: 40.6M, False: 40.6M]
  ------------------
  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|  40.6M|      if (unsigned_val[c] > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (482:11): [True: 0, False: 40.6M]
  ------------------
  483|      0|        return false;
  484|      0|      }
  485|  40.6M|      signed_val[c] = static_cast<SignedDataTypeT>(
  486|  40.6M|          static_cast<int32_t>(unsigned_val[c]) +
  487|  40.6M|          min_signed_values_[num_processed_signed_components + c]);
  488|  40.6M|    }
  489|  40.6M|    att->SetAttributeValue(avi, &signed_val[0]);
  490|  40.6M|  }
  491|     70|  return true;
  492|     70|}

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.85k|      : quantization_bits_(-1),
   54|  2.85k|        max_quantized_value_(-1),
   55|  2.85k|        max_value_(-1),
   56|  2.85k|        dequantization_scale_(1.f),
   57|  2.85k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.61k|  bool SetQuantizationBits(int32_t q) {
   60|  2.61k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 985, False: 1.63k]
  |  Branch (60:18): [True: 160, False: 1.47k]
  ------------------
   61|  1.14k|      return false;
   62|  1.14k|    }
   63|  1.47k|    quantization_bits_ = q;
   64|  1.47k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.47k|    max_value_ = max_quantized_value_ - 1;
   66|  1.47k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.47k|    center_value_ = max_value_ / 2;
   68|  1.47k|    return true;
   69|  2.61k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  4.13M|                                           int32_t* out_t) const {
   77|  4.13M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 4.26k, False: 4.12M]
  |  Branch (77:20): [True: 0, False: 4.26k]
  |  Branch (77:32): [True: 4.26k, False: 4.12M]
  |  Branch (77:42): [True: 0, False: 4.26k]
  ------------------
   78|  4.13M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 3.69M, False: 442k]
  |  Branch (78:29): [True: 11.3k, False: 3.68M]
  ------------------
   79|  11.3k|      s = max_value_;
   80|  11.3k|      t = max_value_;
   81|  4.12M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 4.26k, False: 4.11M]
  |  Branch (81:26): [True: 2.03k, False: 2.23k]
  ------------------
   82|  2.03k|      t = center_value_ - (t - center_value_);
   83|  4.12M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 3.68M, False: 440k]
  |  Branch (83:35): [True: 9.73k, False: 3.67M]
  ------------------
   84|  9.73k|      t = center_value_ + (center_value_ - t);
   85|  4.11M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 3.67M, False: 438k]
  |  Branch (85:35): [True: 1.44k, False: 3.67M]
  ------------------
   86|  1.44k|      s = center_value_ + (center_value_ - s);
   87|  4.10M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.07k, False: 4.10M]
  |  Branch (87:26): [True: 1.69k, False: 2.38k]
  ------------------
   88|  1.69k|      s = center_value_ - (s - center_value_);
   89|  1.69k|    }
   90|       |
   91|  4.13M|    *out_s = s;
   92|  4.13M|    *out_t = t;
   93|  4.13M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  4.13M|                                                       int32_t* out_t) const {
  100|  4.13M|    DRACO_DCHECK_EQ(
  101|  4.13M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  4.13M|        center_value_);
  103|  4.13M|    int32_t s, t;
  104|  4.13M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 2.09M, False: 2.03M]
  ------------------
  105|       |      // Right hemisphere.
  106|  2.09M|      s = (int_vec[1] + center_value_);
  107|  2.09M|      t = (int_vec[2] + center_value_);
  108|  2.09M|    } else {
  109|       |      // Left hemisphere.
  110|  2.03M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 42.0k, False: 1.99M]
  ------------------
  111|  42.0k|        s = std::abs(int_vec[2]);
  112|  1.99M|      } else {
  113|  1.99M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.99M|      }
  115|  2.03M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 47.9k, False: 1.98M]
  ------------------
  116|  47.9k|        t = std::abs(int_vec[1]);
  117|  1.98M|      } else {
  118|  1.98M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.98M|      }
  120|  2.03M|    }
  121|  4.13M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  4.13M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   958k|                                                    float* out_vector) const {
  199|   958k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   958k|                                 in_t * dequantization_scale_ - 1.f,
  201|   958k|                                 out_vector);
  202|   958k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  21.1M|  inline bool IsInDiamond(const int32_t& s, const int32_t& t) const {
  206|       |    // Expect center already at origin.
  207|  21.1M|    DRACO_DCHECK_LE(s, center_value_);
  208|  21.1M|    DRACO_DCHECK_LE(t, center_value_);
  209|  21.1M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  21.1M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  21.1M|    const uint32_t st =
  212|  21.1M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  21.1M|    return st <= center_value_;
  214|  21.1M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  41.5M|  void InvertDiamond(int32_t* s, int32_t* t) const {
  217|       |    // Expect center already at origin.
  218|  41.5M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  41.5M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  41.5M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  41.5M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  41.5M|    int32_t sign_s = 0;
  223|  41.5M|    int32_t sign_t = 0;
  224|  41.5M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 41.2M, False: 293k]
  |  Branch (224:20): [True: 41.0M, False: 186k]
  ------------------
  225|  41.0M|      sign_s = 1;
  226|  41.0M|      sign_t = 1;
  227|  41.0M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 338k, False: 140k]
  |  Branch (227:27): [True: 133k, False: 205k]
  ------------------
  228|   133k|      sign_s = -1;
  229|   133k|      sign_t = -1;
  230|   346k|    } else {
  231|   346k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 140k, False: 205k]
  ------------------
  232|   346k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 205k, False: 140k]
  ------------------
  233|   346k|    }
  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|  41.5M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  41.5M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  41.5M|    uint32_t us = *s;
  241|  41.5M|    uint32_t ut = *t;
  242|  41.5M|    us = us + us - corner_point_s;
  243|  41.5M|    ut = ut + ut - corner_point_t;
  244|  41.5M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 41.2M, False: 346k]
  ------------------
  245|  41.2M|      uint32_t temp = us;
  246|  41.2M|      us = -ut;
  247|  41.2M|      ut = -temp;
  248|  41.2M|    } else {
  249|   346k|      std::swap(us, ut);
  250|   346k|    }
  251|  41.5M|    us = us + corner_point_s;
  252|  41.5M|    ut = ut + corner_point_t;
  253|       |
  254|  41.5M|    *s = us;
  255|  41.5M|    *t = ut;
  256|  41.5M|    *s /= 2;
  257|  41.5M|    *t /= 2;
  258|  41.5M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  42.2M|  int32_t ModMax(int32_t x) const {
  273|  42.2M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 4.64k, False: 42.2M]
  ------------------
  274|  4.64k|      return x - this->max_quantized_value();
  275|  4.64k|    }
  276|  42.2M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 1.97k, False: 42.2M]
  ------------------
  277|  1.97k|      return x + this->max_quantized_value();
  278|  1.97k|    }
  279|  42.2M|    return x;
  280|  42.2M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.41k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  6.62k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|   126M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   958k|                                           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|   958k|    float y = in_s_scaled;
  329|   958k|    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|   958k|    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|   958k|    float x_offset = -x;
  342|   958k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 40.8k, False: 917k]
  ------------------
  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|   958k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 121k, False: 837k]
  ------------------
  348|   958k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 41.7k, False: 917k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   958k|    const float norm_squared = x * x + y * y + z * z;
  352|   958k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 958k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   958k|    } else {
  357|   958k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   958k|      out_vector[0] = x * d;
  359|   958k|      out_vector[1] = y * d;
  360|   958k|      out_vector[2] = z * d;
  361|   958k|    }
  362|   958k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  4.13M|  void CanonicalizeIntegerVector(T* vec) const {
  174|  4.13M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  4.13M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  4.13M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  4.13M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  4.13M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  4.13M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 3.89M, False: 239k]
  ------------------
  181|  3.89M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  3.89M|    } else {
  183|   239k|      vec[0] =
  184|   239k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   239k|          abs_sum;
  186|   239k|      vec[1] =
  187|   239k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   239k|          abs_sum;
  189|   239k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 130k, False: 108k]
  ------------------
  190|   130k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   130k|      } else {
  192|   108k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   108k|      }
  194|   239k|    }
  195|  4.13M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    461|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    461|            attribute, transform, mesh_data),
   52|    461|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    443|                                                                buffer) {
  197|    443|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    443|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    443|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 2, False: 441]
  ------------------
  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|    442|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  2.01k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 1.65k, False: 354]
  ------------------
  214|  1.65k|    uint32_t num_flags;
  215|  1.65k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 10, False: 1.64k]
  ------------------
  216|     10|      return false;
  217|     10|    }
  218|  1.64k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 39, False: 1.60k]
  ------------------
  219|     39|      return false;
  220|     39|    }
  221|  1.60k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 721, False: 888]
  ------------------
  222|    721|      is_crease_edge_[i].resize(num_flags);
  223|    721|      RAnsBitDecoder decoder;
  224|    721|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 39, False: 682]
  ------------------
  225|     39|        return false;
  226|     39|      }
  227|  2.32M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 2.32M, False: 682]
  ------------------
  228|  2.32M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  2.32M|      }
  230|    682|      decoder.EndDecoding();
  231|    682|    }
  232|  1.60k|  }
  233|    354|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    354|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    442|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    322|                          const PointIndex* /* entry_to_point_id_map */) {
   87|    322|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    322|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.61k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.28k, False: 322]
  ------------------
   93|  1.28k|    pred_vals[i].resize(num_components, 0);
   94|  1.28k|  }
   95|    322|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    322|                                         out_data);
   97|       |
   98|    322|  const CornerTable* const table = this->mesh_data().corner_table();
   99|    322|  const std::vector<int32_t>* const vertex_to_data_map =
  100|    322|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    322|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    322|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    322|  const int corner_map_size =
  109|    322|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    322|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 322]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|  1.16M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 1.16M, False: 207]
  ------------------
  114|  1.16M|    const CornerIndex start_corner_id =
  115|  1.16M|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|  1.16M|    CornerIndex corner_id(start_corner_id);
  118|  1.16M|    int num_parallelograms = 0;
  119|  1.16M|    bool first_pass = true;
  120|  2.53M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 1.41M, False: 1.11M]
  ------------------
  121|  1.41M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 99.1k, False: 1.31M]
  ------------------
  122|  1.41M|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|  1.41M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|  99.1k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|  99.1k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 806, False: 98.3k]
  ------------------
  130|    806|          break;
  131|    806|        }
  132|  99.1k|      }
  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.41M|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 1.40M, False: 10.7k]
  ------------------
  137|  1.40M|        corner_id = table->SwingLeft(corner_id);
  138|  1.40M|      } else {
  139|  10.7k|        corner_id = table->SwingRight(corner_id);
  140|  10.7k|      }
  141|  1.41M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 45.4k, False: 1.36M]
  ------------------
  142|  45.4k|        break;
  143|  45.4k|      }
  144|  1.36M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 1.12M, False: 243k]
  |  Branch (144:47): [True: 1.11M, False: 4.89k]
  ------------------
  145|  1.11M|        first_pass = false;
  146|  1.11M|        corner_id = table->SwingRight(start_corner_id);
  147|  1.11M|      }
  148|  1.36M|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|  1.16M|    int num_used_parallelograms = 0;
  153|  1.16M|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 53.1k, False: 1.11M]
  ------------------
  154|  4.70M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 4.65M, False: 53.1k]
  ------------------
  155|  4.65M|        multi_pred_vals[i] = 0;
  156|  4.65M|      }
  157|       |      // Check which parallelograms are actually used.
  158|   152k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 99.0k, False: 53.0k]
  ------------------
  159|  99.0k|        const int context = num_parallelograms - 1;
  160|  99.0k|        const int pos = is_crease_edge_pos[context]++;
  161|  99.0k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 115, False: 98.9k]
  ------------------
  162|    115|          return false;
  163|    115|        }
  164|  98.9k|        const bool is_crease = is_crease_edge_[context][pos];
  165|  98.9k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 26.9k, False: 72.0k]
  ------------------
  166|  26.9k|          ++num_used_parallelograms;
  167|  2.47M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 2.44M, False: 26.9k]
  ------------------
  168|  2.44M|            multi_pred_vals[j] =
  169|  2.44M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  2.44M|          }
  171|  26.9k|        }
  172|  98.9k|      }
  173|  53.1k|    }
  174|  1.16M|    const int dst_offset = p * num_components;
  175|  1.16M|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 1.15M, False: 10.9k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|  1.15M|      const int src_offset = (p - 1) * num_components;
  179|  1.15M|      this->transform().ComputeOriginalValue(
  180|  1.15M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|  1.15M|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|  1.02M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 1.01M, False: 10.9k]
  ------------------
  184|  1.01M|        multi_pred_vals[c] /= num_used_parallelograms;
  185|  1.01M|      }
  186|  10.9k|      this->transform().ComputeOriginalValue(
  187|  10.9k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  10.9k|    }
  189|  1.16M|  }
  190|    207|  return true;
  191|    322|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    643|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    643|            attribute, transform, mesh_data),
   52|    643|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    618|                                                                buffer) {
  197|    618|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    618|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    618|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 12, False: 606]
  ------------------
  199|       |    // Decode prediction mode.
  200|     12|    uint8_t mode;
  201|     12|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 0, False: 12]
  ------------------
  202|      0|      return false;
  203|      0|    }
  204|       |
  205|     12|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 1, False: 11]
  ------------------
  206|       |      // Unsupported mode.
  207|      1|      return false;
  208|      1|    }
  209|     12|  }
  210|    617|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  2.69k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 2.23k, False: 467]
  ------------------
  214|  2.23k|    uint32_t num_flags;
  215|  2.23k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 19, False: 2.21k]
  ------------------
  216|     19|      return false;
  217|     19|    }
  218|  2.21k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 70, False: 2.14k]
  ------------------
  219|     70|      return false;
  220|     70|    }
  221|  2.14k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 981, False: 1.16k]
  ------------------
  222|    981|      is_crease_edge_[i].resize(num_flags);
  223|    981|      RAnsBitDecoder decoder;
  224|    981|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 61, False: 920]
  ------------------
  225|     61|        return false;
  226|     61|      }
  227|  3.20M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 3.20M, False: 920]
  ------------------
  228|  3.20M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  3.20M|      }
  230|    920|      decoder.EndDecoding();
  231|    920|    }
  232|  2.14k|  }
  233|    467|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    467|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    617|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    429|                          const PointIndex* /* entry_to_point_id_map */) {
   87|    429|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    429|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  2.14k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.71k, False: 429]
  ------------------
   93|  1.71k|    pred_vals[i].resize(num_components, 0);
   94|  1.71k|  }
   95|    429|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    429|                                         out_data);
   97|       |
   98|    429|  const CornerTable* const table = this->mesh_data().corner_table();
   99|    429|  const std::vector<int32_t>* const vertex_to_data_map =
  100|    429|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    429|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    429|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    429|  const int corner_map_size =
  109|    429|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    429|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 429]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   211k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 211k, False: 184]
  ------------------
  114|   211k|    const CornerIndex start_corner_id =
  115|   211k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   211k|    CornerIndex corner_id(start_corner_id);
  118|   211k|    int num_parallelograms = 0;
  119|   211k|    bool first_pass = true;
  120|  1.24M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 1.23M, False: 8.46k]
  ------------------
  121|  1.23M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 402k, False: 832k]
  ------------------
  122|  1.23M|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|  1.23M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|   402k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|   402k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 768, False: 401k]
  ------------------
  130|    768|          break;
  131|    768|        }
  132|   402k|      }
  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.23M|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 1.22M, False: 9.08k]
  ------------------
  137|  1.22M|        corner_id = table->SwingLeft(corner_id);
  138|  1.22M|      } else {
  139|  9.08k|        corner_id = table->SwingRight(corner_id);
  140|  9.08k|      }
  141|  1.23M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 202k, False: 1.03M]
  ------------------
  142|   202k|        break;
  143|   202k|      }
  144|  1.03M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 13.0k, False: 1.01M]
  |  Branch (144:47): [True: 8.47k, False: 4.56k]
  ------------------
  145|  8.47k|        first_pass = false;
  146|  8.47k|        corner_id = table->SwingRight(start_corner_id);
  147|  8.47k|      }
  148|  1.03M|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   211k|    int num_used_parallelograms = 0;
  153|   211k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 207k, False: 3.80k]
  ------------------
  154|  5.65M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 5.44M, False: 207k]
  ------------------
  155|  5.44M|        multi_pred_vals[i] = 0;
  156|  5.44M|      }
  157|       |      // Check which parallelograms are actually used.
  158|   609k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 401k, False: 207k]
  ------------------
  159|   401k|        const int context = num_parallelograms - 1;
  160|   401k|        const int pos = is_crease_edge_pos[context]++;
  161|   401k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 245, False: 401k]
  ------------------
  162|    245|          return false;
  163|    245|        }
  164|   401k|        const bool is_crease = is_crease_edge_[context][pos];
  165|   401k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 74.9k, False: 326k]
  ------------------
  166|  74.9k|          ++num_used_parallelograms;
  167|  3.03M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 2.95M, False: 74.9k]
  ------------------
  168|  2.95M|            multi_pred_vals[j] =
  169|  2.95M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  2.95M|          }
  171|  74.9k|        }
  172|   401k|      }
  173|   207k|    }
  174|   211k|    const int dst_offset = p * num_components;
  175|   211k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 175k, False: 35.3k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|   175k|      const int src_offset = (p - 1) * num_components;
  179|   175k|      this->transform().ComputeOriginalValue(
  180|   175k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|   175k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|  1.55M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 1.51M, False: 35.3k]
  ------------------
  184|  1.51M|        multi_pred_vals[c] /= num_used_parallelograms;
  185|  1.51M|      }
  186|  35.3k|      this->transform().ComputeOriginalValue(
  187|  35.3k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  35.3k|    }
  189|   211k|  }
  190|    184|  return true;
  191|    429|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.66k|           const std::vector<int32_t>* vertex_to_data_map) {
   38|  2.66k|    mesh_ = mesh;
   39|  2.66k|    corner_table_ = table;
   40|  2.66k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.66k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.66k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  24.4M|  const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  16.5M|  const std::vector<int32_t>* vertex_to_data_map() const {
   47|  16.5M|    return vertex_to_data_map_;
   48|  16.5M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  10.3M|  const std::vector<CornerIndex>* data_to_corner_map() const {
   50|  10.3M|    return data_to_corner_map_;
   51|  10.3M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  3.18k|           const std::vector<int32_t>* vertex_to_data_map) {
   38|  3.18k|    mesh_ = mesh;
   39|  3.18k|    corner_table_ = table;
   40|  3.18k|    data_to_corner_map_ = data_to_corner_map;
   41|  3.18k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  3.18k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  9.78M|  const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  8.10M|  const std::vector<int32_t>* vertex_to_data_map() const {
   47|  8.10M|    return vertex_to_data_map_;
   48|  8.10M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.76M|  const std::vector<CornerIndex>* data_to_corner_map() const {
   50|  2.76M|    return data_to_corner_map_;
   51|  2.76M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  2.66k|      : mesh_(nullptr),
   31|  2.66k|        corner_table_(nullptr),
   32|  2.66k|        vertex_to_data_map_(nullptr),
   33|  2.66k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  3.18k|      : mesh_(nullptr),
   31|  3.18k|        corner_table_(nullptr),
   32|  3.18k|        vertex_to_data_map_(nullptr),
   33|  3.18k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  1.43M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   154k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   480k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   216k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.32k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.32k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  16.4M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.84k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.84k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  3.75M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    158|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    158|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    168|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    168|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    151|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    151|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    156|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    156|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    314|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    158|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    158|    DRACO_DCHECK_EQ(i, 0);
   70|    158|    (void)i;
   71|    158|    return GeometryAttribute::POSITION;
   72|    158|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    158|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    158|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 158]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    158|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 156]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    156|    predictor_.SetPositionAttribute(*att);
   82|    156|    return true;
   83|    158|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    156|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    156|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 8, False: 148]
  ------------------
  148|      8|    return false;
  149|      8|  }
  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: 31, False: 117]
  ------------------
  153|     31|    uint8_t prediction_mode;
  154|     31|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 31]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     31|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 29]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     29|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 29]
  ------------------
  163|     29|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     29|  }
  167|    146|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    146|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 11, False: 135]
  ------------------
  171|     11|    return false;
  172|     11|  }
  173|       |
  174|    135|  return true;
  175|    146|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    135|                                      const PointIndex* entry_to_point_id_map) {
  103|    135|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    135|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    135|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    135|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    135|  const int corner_map_size =
  111|    135|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    135|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 135]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    135|  VectorD<int32_t, 3> pred_normal_3d;
  117|    135|  int32_t pred_normal_oct[2];
  118|       |
  119|  1.43M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 1.43M, False: 135]
  ------------------
  120|  1.43M|    const CornerIndex corner_id =
  121|  1.43M|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|  1.43M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|  1.43M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|  1.43M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|  1.43M|                    octahedron_tool_box_.center_value());
  128|  1.43M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 1.27M, False: 160k]
  ------------------
  129|  1.27M|      pred_normal_3d = -pred_normal_3d;
  130|  1.27M|    }
  131|  1.43M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|  1.43M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|  1.43M|    const int data_offset = data_id * 2;
  135|  1.43M|    this->transform().ComputeOriginalValue(
  136|  1.43M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|  1.43M|  }
  138|    135|  flip_normal_bit_decoder_.EndDecoding();
  139|    135|  return true;
  140|    135|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    135|  void SetQuantizationBits(int q) {
   85|    135|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    135|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    333|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    168|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    168|    DRACO_DCHECK_EQ(i, 0);
   70|    168|    (void)i;
   71|    168|    return GeometryAttribute::POSITION;
   72|    168|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    168|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    168|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 168]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    168|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 165]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    165|    predictor_.SetPositionAttribute(*att);
   82|    165|    return true;
   83|    168|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    164|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    164|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 7, False: 157]
  ------------------
  148|      7|    return false;
  149|      7|  }
  150|       |
  151|    157|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    157|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    157|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 28, False: 129]
  ------------------
  153|     28|    uint8_t prediction_mode;
  154|     28|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 28]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     28|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 27]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     27|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 27]
  ------------------
  163|     27|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     27|  }
  167|    156|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    156|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 2, False: 154]
  ------------------
  171|      2|    return false;
  172|      2|  }
  173|       |
  174|    154|  return true;
  175|    156|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    154|                                      const PointIndex* entry_to_point_id_map) {
  103|    154|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    154|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    154|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    154|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    154|  const int corner_map_size =
  111|    154|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    154|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 154]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    154|  VectorD<int32_t, 3> pred_normal_3d;
  117|    154|  int32_t pred_normal_oct[2];
  118|       |
  119|   154k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 154k, False: 154]
  ------------------
  120|   154k|    const CornerIndex corner_id =
  121|   154k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   154k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   154k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   154k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   154k|                    octahedron_tool_box_.center_value());
  128|   154k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 112k, False: 42.2k]
  ------------------
  129|   112k|      pred_normal_3d = -pred_normal_3d;
  130|   112k|    }
  131|   154k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   154k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   154k|    const int data_offset = data_id * 2;
  135|   154k|    this->transform().ComputeOriginalValue(
  136|   154k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   154k|  }
  138|    154|  flip_normal_bit_decoder_.EndDecoding();
  139|    154|  return true;
  140|    154|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    154|  void SetQuantizationBits(int q) {
   85|    154|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    154|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    300|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    151|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    151|    DRACO_DCHECK_EQ(i, 0);
   70|    151|    (void)i;
   71|    151|    return GeometryAttribute::POSITION;
   72|    151|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    151|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    151|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 151]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    151|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 149]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    149|    predictor_.SetPositionAttribute(*att);
   82|    149|    return true;
   83|    151|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    147|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    147|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 7, False: 140]
  ------------------
  148|      7|    return false;
  149|      7|  }
  150|       |
  151|    140|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    140|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    140|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 29, False: 111]
  ------------------
  153|     29|    uint8_t prediction_mode;
  154|     29|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 29]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     29|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 27]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     27|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 27]
  ------------------
  163|     27|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     27|  }
  167|    138|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    138|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 8, False: 130]
  ------------------
  171|      8|    return false;
  172|      8|  }
  173|       |
  174|    130|  return true;
  175|    138|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    130|                                      const PointIndex* entry_to_point_id_map) {
  103|    130|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    130|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    130|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    130|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    130|  const int corner_map_size =
  111|    130|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    130|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 130]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    130|  VectorD<int32_t, 3> pred_normal_3d;
  117|    130|  int32_t pred_normal_oct[2];
  118|       |
  119|   480k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 480k, False: 130]
  ------------------
  120|   480k|    const CornerIndex corner_id =
  121|   480k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   480k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   480k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   480k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   480k|                    octahedron_tool_box_.center_value());
  128|   480k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 414k, False: 66.7k]
  ------------------
  129|   414k|      pred_normal_3d = -pred_normal_3d;
  130|   414k|    }
  131|   480k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   480k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   480k|    const int data_offset = data_id * 2;
  135|   480k|    this->transform().ComputeOriginalValue(
  136|   480k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   480k|  }
  138|    130|  flip_normal_bit_decoder_.EndDecoding();
  139|    130|  return true;
  140|    130|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    130|  void SetQuantizationBits(int q) {
   85|    130|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    130|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    310|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    156|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    156|    DRACO_DCHECK_EQ(i, 0);
   70|    156|    (void)i;
   71|    156|    return GeometryAttribute::POSITION;
   72|    156|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    156|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    156|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 156]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    156|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 154]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    154|    predictor_.SetPositionAttribute(*att);
   82|    154|    return true;
   83|    156|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    154|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    154|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 148]
  ------------------
  148|      6|    return false;
  149|      6|  }
  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: 36, False: 112]
  ------------------
  153|     36|    uint8_t prediction_mode;
  154|     36|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 35]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     35|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 3, False: 32]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      3|      return false;
  160|      3|    }
  161|       |
  162|     32|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 32]
  ------------------
  163|     32|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     32|  }
  167|    144|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    144|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 2, False: 142]
  ------------------
  171|      2|    return false;
  172|      2|  }
  173|       |
  174|    142|  return true;
  175|    144|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    142|                                      const PointIndex* entry_to_point_id_map) {
  103|    142|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    142|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    142|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    142|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    142|  const int corner_map_size =
  111|    142|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    142|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 142]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    142|  VectorD<int32_t, 3> pred_normal_3d;
  117|    142|  int32_t pred_normal_oct[2];
  118|       |
  119|   216k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 216k, False: 142]
  ------------------
  120|   216k|    const CornerIndex corner_id =
  121|   216k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   216k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   216k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   216k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   216k|                    octahedron_tool_box_.center_value());
  128|   216k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 215k, False: 957]
  ------------------
  129|   215k|      pred_normal_3d = -pred_normal_3d;
  130|   215k|    }
  131|   216k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   216k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   216k|    const int data_offset = data_id * 2;
  135|   216k|    this->transform().ComputeOriginalValue(
  136|   216k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   216k|  }
  138|    142|  flip_normal_bit_decoder_.EndDecoding();
  139|    142|  return true;
  140|    142|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    142|  void SetQuantizationBits(int q) {
   85|    142|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    142|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    410|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    410|            attribute, transform, mesh_data),
   37|    410|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    817|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    410|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    410|    DRACO_DCHECK_EQ(i, 0);
   70|    410|    (void)i;
   71|    410|    return GeometryAttribute::POSITION;
   72|    410|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    410|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    410|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 410]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    410|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 407]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    407|    predictor_.SetPositionAttribute(*att);
   82|    407|    return true;
   83|    410|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    404|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    404|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 22, False: 382]
  ------------------
  148|     22|    return false;
  149|     22|  }
  150|       |
  151|    382|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    382|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    382|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 113, False: 269]
  ------------------
  153|    113|    uint8_t prediction_mode;
  154|    113|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 113]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|    113|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 112]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|    112|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 112]
  ------------------
  163|    112|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|    112|  }
  167|    381|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    381|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 24, False: 357]
  ------------------
  171|     24|    return false;
  172|     24|  }
  173|       |
  174|    357|  return true;
  175|    381|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    357|                                      const PointIndex* entry_to_point_id_map) {
  103|    357|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    357|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    357|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    357|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    357|  const int corner_map_size =
  111|    357|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    357|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 357]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    357|  VectorD<int32_t, 3> pred_normal_3d;
  117|    357|  int32_t pred_normal_oct[2];
  118|       |
  119|  1.66M|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 1.66M, False: 357]
  ------------------
  120|  1.66M|    const CornerIndex corner_id =
  121|  1.66M|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|  1.66M|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|  1.66M|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|  1.66M|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|  1.66M|                    octahedron_tool_box_.center_value());
  128|  1.66M|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 1.58M, False: 80.5k]
  ------------------
  129|  1.58M|      pred_normal_3d = -pred_normal_3d;
  130|  1.58M|    }
  131|  1.66M|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|  1.66M|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|  1.66M|    const int data_offset = data_id * 2;
  135|  1.66M|    this->transform().ComputeOriginalValue(
  136|  1.66M|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|  1.66M|  }
  138|    357|  flip_normal_bit_decoder_.EndDecoding();
  139|    357|  return true;
  140|    357|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    357|  void SetQuantizationBits(int q) {
   85|    357|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    357|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    532|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    532|            attribute, transform, mesh_data),
   37|    532|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|  1.06k|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    532|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    532|    DRACO_DCHECK_EQ(i, 0);
   70|    532|    (void)i;
   71|    532|    return GeometryAttribute::POSITION;
   72|    532|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    531|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    531|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 531]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    531|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 530]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    530|    predictor_.SetPositionAttribute(*att);
   82|    530|    return true;
   83|    531|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    520|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    520|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 11, False: 509]
  ------------------
  148|     11|    return false;
  149|     11|  }
  150|       |
  151|    509|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    509|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    509|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 170, False: 339]
  ------------------
  153|    170|    uint8_t prediction_mode;
  154|    170|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 3, False: 167]
  ------------------
  155|      3|      return false;
  156|      3|    }
  157|    167|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 166]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|    166|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 166]
  ------------------
  163|    166|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|    166|  }
  167|    505|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    505|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 24, False: 481]
  ------------------
  171|     24|    return false;
  172|     24|  }
  173|       |
  174|    481|  return true;
  175|    505|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    481|                                      const PointIndex* entry_to_point_id_map) {
  103|    481|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    481|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    481|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    481|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    481|  const int corner_map_size =
  111|    481|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    481|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 481]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    481|  VectorD<int32_t, 3> pred_normal_3d;
  117|    481|  int32_t pred_normal_oct[2];
  118|       |
  119|   179k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 178k, False: 481]
  ------------------
  120|   178k|    const CornerIndex corner_id =
  121|   178k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   178k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   178k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   178k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   178k|                    octahedron_tool_box_.center_value());
  128|   178k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 161k, False: 17.1k]
  ------------------
  129|   161k|      pred_normal_3d = -pred_normal_3d;
  130|   161k|    }
  131|   178k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   178k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   178k|    const int data_offset = data_id * 2;
  135|   178k|    this->transform().ComputeOriginalValue(
  136|   178k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   178k|  }
  138|    481|  flip_normal_bit_decoder_.EndDecoding();
  139|    481|  return true;
  140|    481|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    481|  void SetQuantizationBits(int q) {
   85|    481|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    481|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    158|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    158|            attribute, transform, mesh_data),
   37|    158|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    168|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    168|            attribute, transform, mesh_data),
   37|    168|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    151|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    151|            attribute, transform, mesh_data),
   37|    151|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    156|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    156|            attribute, transform, mesh_data),
   37|    156|        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: 27, False: 160]
  ------------------
  105|     27|      this->normal_prediction_mode_ = mode;
  106|     27|      return true;
  107|    160|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 160, False: 0]
  ------------------
  108|    160|      this->normal_prediction_mode_ = mode;
  109|    160|      return true;
  110|    160|    }
  111|      0|    return false;
  112|    187|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.43M|                             DataTypeT* prediction) override {
   42|  1.43M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.43M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.43M|    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.43M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.43M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.43M|    VectorD<int64_t, 3> normal;
   53|  1.43M|    CornerIndex c_next, c_prev;
   54|  3.13M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.70M, False: 1.43M]
  ------------------
   55|       |      // Getting corners.
   56|  1.70M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 108, False: 1.70M]
  ------------------
   57|    108|        c_next = corner_table->Next(corner_id);
   58|    108|        c_prev = corner_table->Previous(corner_id);
   59|  1.70M|      } else {
   60|  1.70M|        c_next = corner_table->Next(cit.Corner());
   61|  1.70M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.70M|      }
   63|  1.70M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.70M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.70M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.70M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.70M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.70M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.70M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.70M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.70M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.70M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.70M|      cit.Next();
   81|  1.70M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.43M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.43M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 72, False: 1.43M]
  ------------------
   86|     72|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     72|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 32, False: 40]
  ------------------
   88|     32|        const int64_t quotient = abs_sum / upper_bound;
   89|     32|        normal = normal / quotient;
   90|     32|      }
   91|  1.43M|    } else {
   92|  1.43M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.43M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.52k, False: 1.43M]
  ------------------
   94|  1.52k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.52k|        normal = normal / quotient;
   96|  1.52k|      }
   97|  1.43M|    }
   98|  1.43M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.43M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.43M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.43M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.43M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    195|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    195|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 26, False: 169]
  ------------------
  105|     26|      this->normal_prediction_mode_ = mode;
  106|     26|      return true;
  107|    169|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 169, False: 0]
  ------------------
  108|    169|      this->normal_prediction_mode_ = mode;
  109|    169|      return true;
  110|    169|    }
  111|      0|    return false;
  112|    195|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   154k|                             DataTypeT* prediction) override {
   42|   154k|    DRACO_DCHECK(this->IsInitialized());
   43|   154k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   154k|    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|   154k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   154k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   154k|    VectorD<int64_t, 3> normal;
   53|   154k|    CornerIndex c_next, c_prev;
   54|  1.07M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 920k, False: 154k]
  ------------------
   55|       |      // Getting corners.
   56|   920k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 150, False: 920k]
  ------------------
   57|    150|        c_next = corner_table->Next(corner_id);
   58|    150|        c_prev = corner_table->Previous(corner_id);
   59|   920k|      } else {
   60|   920k|        c_next = corner_table->Next(cit.Corner());
   61|   920k|        c_prev = corner_table->Previous(cit.Corner());
   62|   920k|      }
   63|   920k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   920k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   920k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   920k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   920k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   920k|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|   920k|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|   920k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   920k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   920k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   920k|      cit.Next();
   81|   920k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   154k|    constexpr int64_t upper_bound = 1 << 29;
   85|   154k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 100, False: 154k]
  ------------------
   86|    100|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    100|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 33, False: 67]
  ------------------
   88|     33|        const int64_t quotient = abs_sum / upper_bound;
   89|     33|        normal = normal / quotient;
   90|     33|      }
   91|   154k|    } else {
   92|   154k|      const int64_t abs_sum = normal.AbsSum();
   93|   154k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 88.7k, False: 65.7k]
  ------------------
   94|  88.7k|        const int64_t quotient = abs_sum / upper_bound;
   95|  88.7k|        normal = normal / quotient;
   96|  88.7k|      }
   97|   154k|    }
   98|   154k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   154k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   154k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   154k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   154k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    178|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    178|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 24, False: 154]
  ------------------
  105|     24|      this->normal_prediction_mode_ = mode;
  106|     24|      return true;
  107|    154|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 154, False: 0]
  ------------------
  108|    154|      this->normal_prediction_mode_ = mode;
  109|    154|      return true;
  110|    154|    }
  111|      0|    return false;
  112|    178|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   480k|                             DataTypeT* prediction) override {
   42|   480k|    DRACO_DCHECK(this->IsInitialized());
   43|   480k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   480k|    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|   480k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   480k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   480k|    VectorD<int64_t, 3> normal;
   53|   480k|    CornerIndex c_next, c_prev;
   54|  1.35M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 875k, False: 480k]
  ------------------
   55|       |      // Getting corners.
   56|   875k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 138, False: 875k]
  ------------------
   57|    138|        c_next = corner_table->Next(corner_id);
   58|    138|        c_prev = corner_table->Previous(corner_id);
   59|   875k|      } else {
   60|   875k|        c_next = corner_table->Next(cit.Corner());
   61|   875k|        c_prev = corner_table->Previous(cit.Corner());
   62|   875k|      }
   63|   875k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   875k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   875k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   875k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   875k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   875k|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|   875k|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|   875k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   875k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   875k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   875k|      cit.Next();
   81|   875k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   480k|    constexpr int64_t upper_bound = 1 << 29;
   85|   480k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 92, False: 480k]
  ------------------
   86|     92|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     92|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 25, False: 67]
  ------------------
   88|     25|        const int64_t quotient = abs_sum / upper_bound;
   89|     25|        normal = normal / quotient;
   90|     25|      }
   91|   480k|    } else {
   92|   480k|      const int64_t abs_sum = normal.AbsSum();
   93|   480k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.80k, False: 478k]
  ------------------
   94|  1.80k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.80k|        normal = normal / quotient;
   96|  1.80k|      }
   97|   480k|    }
   98|   480k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   480k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   480k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   480k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   480k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    188|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    188|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 31, False: 157]
  ------------------
  105|     31|      this->normal_prediction_mode_ = mode;
  106|     31|      return true;
  107|    157|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 157, False: 0]
  ------------------
  108|    157|      this->normal_prediction_mode_ = mode;
  109|    157|      return true;
  110|    157|    }
  111|      0|    return false;
  112|    188|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   216k|                             DataTypeT* prediction) override {
   42|   216k|    DRACO_DCHECK(this->IsInitialized());
   43|   216k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   216k|    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|   216k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   216k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   216k|    VectorD<int64_t, 3> normal;
   53|   216k|    CornerIndex c_next, c_prev;
   54|  1.50M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.29M, False: 216k]
  ------------------
   55|       |      // Getting corners.
   56|  1.29M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 180, False: 1.29M]
  ------------------
   57|    180|        c_next = corner_table->Next(corner_id);
   58|    180|        c_prev = corner_table->Previous(corner_id);
   59|  1.29M|      } else {
   60|  1.29M|        c_next = corner_table->Next(cit.Corner());
   61|  1.29M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.29M|      }
   63|  1.29M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.29M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.29M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.29M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.29M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.29M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.29M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.29M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.29M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.29M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.29M|      cit.Next();
   81|  1.29M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   216k|    constexpr int64_t upper_bound = 1 << 29;
   85|   216k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 120, False: 216k]
  ------------------
   86|    120|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    120|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 34, False: 86]
  ------------------
   88|     34|        const int64_t quotient = abs_sum / upper_bound;
   89|     34|        normal = normal / quotient;
   90|     34|      }
   91|   216k|    } else {
   92|   216k|      const int64_t abs_sum = normal.AbsSum();
   93|   216k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 108k, False: 107k]
  ------------------
   94|   108k|        const int64_t quotient = abs_sum / upper_bound;
   95|   108k|        normal = normal / quotient;
   96|   108k|      }
   97|   216k|    }
   98|   216k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   216k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   216k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   216k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   216k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    410|      : Base(md) {
   35|    410|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    410|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    522|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    522|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 110, False: 412]
  ------------------
  105|    110|      this->normal_prediction_mode_ = mode;
  106|    110|      return true;
  107|    412|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 412, False: 0]
  ------------------
  108|    412|      this->normal_prediction_mode_ = mode;
  109|    412|      return true;
  110|    412|    }
  111|      0|    return false;
  112|    522|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  1.66M|                             DataTypeT* prediction) override {
   42|  1.66M|    DRACO_DCHECK(this->IsInitialized());
   43|  1.66M|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  1.66M|    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.66M|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  1.66M|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  1.66M|    VectorD<int64_t, 3> normal;
   53|  1.66M|    CornerIndex c_next, c_prev;
   54|  3.41M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.74M, False: 1.66M]
  ------------------
   55|       |      // Getting corners.
   56|  1.74M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 594, False: 1.74M]
  ------------------
   57|    594|        c_next = corner_table->Next(corner_id);
   58|    594|        c_prev = corner_table->Previous(corner_id);
   59|  1.74M|      } else {
   60|  1.74M|        c_next = corner_table->Next(cit.Corner());
   61|  1.74M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.74M|      }
   63|  1.74M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.74M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.74M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.74M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.74M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.74M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.74M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.74M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.74M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.74M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.74M|      cit.Next();
   81|  1.74M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  1.66M|    constexpr int64_t upper_bound = 1 << 29;
   85|  1.66M|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 540, False: 1.66M]
  ------------------
   86|    540|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    540|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 171, False: 369]
  ------------------
   88|    171|        const int64_t quotient = abs_sum / upper_bound;
   89|    171|        normal = normal / quotient;
   90|    171|      }
   91|  1.66M|    } else {
   92|  1.66M|      const int64_t abs_sum = normal.AbsSum();
   93|  1.66M|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.61k, False: 1.66M]
  ------------------
   94|  2.61k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.61k|        normal = normal / quotient;
   96|  2.61k|      }
   97|  1.66M|    }
   98|  1.66M|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  1.66M|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  1.66M|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  1.66M|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  1.66M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    532|      : Base(md) {
   35|    532|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    532|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    698|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    698|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 164, False: 534]
  ------------------
  105|    164|      this->normal_prediction_mode_ = mode;
  106|    164|      return true;
  107|    534|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 534, False: 0]
  ------------------
  108|    534|      this->normal_prediction_mode_ = mode;
  109|    534|      return true;
  110|    534|    }
  111|      0|    return false;
  112|    698|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   178k|                             DataTypeT* prediction) override {
   42|   178k|    DRACO_DCHECK(this->IsInitialized());
   43|   178k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   178k|    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|   178k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   178k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   178k|    VectorD<int64_t, 3> normal;
   53|   178k|    CornerIndex c_next, c_prev;
   54|  1.17M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 994k, False: 178k]
  ------------------
   55|       |      // Getting corners.
   56|   994k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 966, False: 993k]
  ------------------
   57|    966|        c_next = corner_table->Next(corner_id);
   58|    966|        c_prev = corner_table->Previous(corner_id);
   59|   993k|      } else {
   60|   993k|        c_next = corner_table->Next(cit.Corner());
   61|   993k|        c_prev = corner_table->Previous(cit.Corner());
   62|   993k|      }
   63|   994k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   994k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   994k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   994k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   994k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   994k|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|   994k|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|   994k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   994k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   994k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   994k|      cit.Next();
   81|   994k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   178k|    constexpr int64_t upper_bound = 1 << 29;
   85|   178k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 930, False: 178k]
  ------------------
   86|    930|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    930|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 195, False: 735]
  ------------------
   88|    195|        const int64_t quotient = abs_sum / upper_bound;
   89|    195|        normal = normal / quotient;
   90|    195|      }
   91|   178k|    } else {
   92|   178k|      const int64_t abs_sum = normal.AbsSum();
   93|   178k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 5.53k, False: 172k]
  ------------------
   94|  5.53k|        const int64_t quotient = abs_sum / upper_bound;
   95|  5.53k|        normal = normal / quotient;
   96|  5.53k|      }
   97|   178k|    }
   98|   178k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   178k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   178k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   178k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   178k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    158|      : Base(md) {
   35|    158|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    158|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    168|      : Base(md) {
   35|    168|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    168|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    151|      : Base(md) {
   35|    151|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    151|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    156|      : Base(md) {
   35|    156|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    156|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  4.83M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  4.83M|    DRACO_DCHECK(this->IsInitialized());
   73|  4.83M|    const auto corner_table = mesh_data_.corner_table();
   74|  4.83M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  4.83M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  4.83M|    return GetPositionForDataId(data_id);
   77|  4.83M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  4.83M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  4.83M|    DRACO_DCHECK(this->IsInitialized());
   65|  4.83M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  4.83M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  4.83M|    VectorD<int64_t, 3> pos;
   68|  4.83M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  4.83M|    return pos;
   70|  4.83M|  }
_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|    135|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    135|    entry_to_point_id_map_ = map;
   46|    135|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.99M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.99M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.99M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.99M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.99M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.99M|    return GetPositionForDataId(data_id);
   77|  1.99M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.99M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.99M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.99M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.99M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.99M|    VectorD<int64_t, 3> pos;
   68|  1.99M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.99M|    return pos;
   70|  1.99M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    165|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    165|    pos_attribute_ = &position_attribute;
   43|    165|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    154|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    154|    entry_to_point_id_map_ = map;
   46|    154|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.23M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.23M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.23M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.23M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.23M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.23M|    return GetPositionForDataId(data_id);
   77|  2.23M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.23M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.23M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.23M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.23M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.23M|    VectorD<int64_t, 3> pos;
   68|  2.23M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.23M|    return pos;
   70|  2.23M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    149|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    149|    pos_attribute_ = &position_attribute;
   43|    149|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    130|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    130|    entry_to_point_id_map_ = map;
   46|    130|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.80M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.80M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.80M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.80M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.80M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.80M|    return GetPositionForDataId(data_id);
   77|  2.80M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.80M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.80M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.80M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.80M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.80M|    VectorD<int64_t, 3> pos;
   68|  2.80M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.80M|    return pos;
   70|  2.80M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    154|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    154|    pos_attribute_ = &position_attribute;
   43|    154|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    142|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    142|    entry_to_point_id_map_ = map;
   46|    142|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    410|      : pos_attribute_(nullptr),
   36|    410|        entry_to_point_id_map_(nullptr),
   37|    410|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    410|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  5.16M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  5.16M|    DRACO_DCHECK(this->IsInitialized());
   73|  5.16M|    const auto corner_table = mesh_data_.corner_table();
   74|  5.16M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  5.16M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  5.16M|    return GetPositionForDataId(data_id);
   77|  5.16M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  5.16M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  5.16M|    DRACO_DCHECK(this->IsInitialized());
   65|  5.16M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  5.16M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  5.16M|    VectorD<int64_t, 3> pos;
   68|  5.16M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  5.16M|    return pos;
   70|  5.16M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    407|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    407|    pos_attribute_ = &position_attribute;
   43|    407|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    357|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    357|    entry_to_point_id_map_ = map;
   46|    357|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    532|      : pos_attribute_(nullptr),
   36|    532|        entry_to_point_id_map_(nullptr),
   37|    532|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    532|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.16M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.16M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.16M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.16M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.16M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.16M|    return GetPositionForDataId(data_id);
   77|  2.16M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.16M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.16M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.16M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.16M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.16M|    VectorD<int64_t, 3> pos;
   68|  2.16M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.16M|    return pos;
   70|  2.16M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    530|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    530|    pos_attribute_ = &position_attribute;
   43|    530|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    481|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    481|    entry_to_point_id_map_ = map;
   46|    481|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    158|      : pos_attribute_(nullptr),
   36|    158|        entry_to_point_id_map_(nullptr),
   37|    158|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    158|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    168|      : pos_attribute_(nullptr),
   36|    168|        entry_to_point_id_map_(nullptr),
   37|    168|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    168|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    151|      : pos_attribute_(nullptr),
   36|    151|        entry_to_point_id_map_(nullptr),
   37|    151|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    151|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    156|      : pos_attribute_(nullptr),
   36|    156|        entry_to_point_id_map_(nullptr),
   37|    156|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    156|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    373|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    373|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    355|                          const PointIndex* /* entry_to_point_id_map */) {
   64|    355|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    355|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    355|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    355|      new DataTypeT[num_components]());
   70|       |
   71|    355|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    355|  const CornerTable* const table = this->mesh_data().corner_table();
   74|    355|  const std::vector<int32_t>* const vertex_to_data_map =
   75|    355|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    355|  const int corner_map_size =
   78|    355|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    355|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 355]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|  2.05M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 2.05M, False: 355]
  ------------------
   83|  2.05M|    const CornerIndex start_corner_id =
   84|  2.05M|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|  2.05M|    CornerIndex corner_id(start_corner_id);
   87|  2.05M|    int num_parallelograms = 0;
   88|   160M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 158M, False: 2.05M]
  ------------------
   89|   158M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|   158M|    }
   91|  4.69M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 2.64M, False: 2.05M]
  ------------------
   92|  2.64M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 241k, False: 2.40M]
  ------------------
   93|  2.64M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  2.64M|              num_components, parallelogram_pred_vals.get())) {
   95|  18.6M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 18.3M, False: 241k]
  ------------------
   96|  18.3M|          pred_vals[c] =
   97|  18.3M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  18.3M|        }
   99|   241k|        ++num_parallelograms;
  100|   241k|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  2.64M|      corner_id = table->SwingRight(corner_id);
  104|  2.64M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 113k, False: 2.53M]
  ------------------
  105|   113k|        corner_id = kInvalidCornerIndex;
  106|   113k|      }
  107|  2.64M|    }
  108|       |
  109|  2.05M|    const int dst_offset = p * num_components;
  110|  2.05M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 1.92M, False: 129k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  1.92M|      const int src_offset = (p - 1) * num_components;
  114|  1.92M|      this->transform().ComputeOriginalValue(
  115|  1.92M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|  1.92M|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  10.0M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 9.87M, False: 129k]
  ------------------
  119|  9.87M|        pred_vals[c] /= num_parallelograms;
  120|  9.87M|      }
  121|   129k|      this->transform().ComputeOriginalValue(
  122|   129k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|   129k|    }
  124|  2.05M|  }
  125|    355|  return true;
  126|    355|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    447|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    447|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    429|                          const PointIndex* /* entry_to_point_id_map */) {
   64|    429|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    429|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    429|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    429|      new DataTypeT[num_components]());
   70|       |
   71|    429|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    429|  const CornerTable* const table = this->mesh_data().corner_table();
   74|    429|  const std::vector<int32_t>* const vertex_to_data_map =
   75|    429|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    429|  const int corner_map_size =
   78|    429|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    429|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 429]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|   822k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 822k, False: 429]
  ------------------
   83|   822k|    const CornerIndex start_corner_id =
   84|   822k|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|   822k|    CornerIndex corner_id(start_corner_id);
   87|   822k|    int num_parallelograms = 0;
   88|  27.5M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 26.6M, False: 822k]
  ------------------
   89|  26.6M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  26.6M|    }
   91|  5.68M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 4.86M, False: 822k]
  ------------------
   92|  4.86M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 1.60M, False: 3.26M]
  ------------------
   93|  4.86M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  4.86M|              num_components, parallelogram_pred_vals.get())) {
   95|  53.6M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 52.0M, False: 1.60M]
  ------------------
   96|  52.0M|          pred_vals[c] =
   97|  52.0M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  52.0M|        }
   99|  1.60M|        ++num_parallelograms;
  100|  1.60M|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  4.86M|      corner_id = table->SwingRight(corner_id);
  104|  4.86M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 806k, False: 4.05M]
  ------------------
  105|   806k|        corner_id = kInvalidCornerIndex;
  106|   806k|      }
  107|  4.86M|    }
  108|       |
  109|   822k|    const int dst_offset = p * num_components;
  110|   822k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 1.68k, False: 820k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  1.68k|      const int src_offset = (p - 1) * num_components;
  114|  1.68k|      this->transform().ComputeOriginalValue(
  115|  1.68k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|   820k|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  27.4M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 26.6M, False: 820k]
  ------------------
  119|  26.6M|        pred_vals[c] /= num_parallelograms;
  120|  26.6M|      }
  121|   820k|      this->transform().ComputeOriginalValue(
  122|   820k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|   820k|    }
  124|   822k|  }
  125|    429|  return true;
  126|    429|}

_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    607|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    607|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    578|                          const PointIndex* /* entry_to_point_id_map */) {
   61|    578|  this->transform().Init(num_components);
   62|       |
   63|    578|  const CornerTable* const table = this->mesh_data().corner_table();
   64|    578|  const std::vector<int32_t>* const vertex_to_data_map =
   65|    578|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    578|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    578|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    578|  const int corner_map_size =
   74|    578|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|    578|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (75:7): [True: 0, False: 578]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|  1.36M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (78:19): [True: 1.36M, False: 578]
  ------------------
   79|  1.36M|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   80|  1.36M|    const int dst_offset = p * num_components;
   81|  1.36M|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (81:9): [True: 1.31M, False: 49.1k]
  ------------------
   82|  1.36M|                                        *vertex_to_data_map, out_data,
   83|  1.36M|                                        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.31M|      const int src_offset = (p - 1) * num_components;
   88|  1.31M|      this->transform().ComputeOriginalValue(
   89|  1.31M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   90|  1.31M|    } else {
   91|       |      // Apply the parallelogram prediction.
   92|  49.1k|      this->transform().ComputeOriginalValue(
   93|  49.1k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   94|  49.1k|    }
   95|  1.36M|  }
   96|    578|  return true;
   97|    578|}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    727|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    727|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    682|                          const PointIndex* /* entry_to_point_id_map */) {
   61|    682|  this->transform().Init(num_components);
   62|       |
   63|    682|  const CornerTable* const table = this->mesh_data().corner_table();
   64|    682|  const std::vector<int32_t>* const vertex_to_data_map =
   65|    682|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    682|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    682|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    682|  const int corner_map_size =
   74|    682|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|    682|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (75:7): [True: 0, False: 682]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|   610k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (78:19): [True: 609k, False: 682]
  ------------------
   79|   609k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   80|   609k|    const int dst_offset = p * num_components;
   81|   609k|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (81:9): [True: 3.30k, False: 606k]
  ------------------
   82|   609k|                                        *vertex_to_data_map, out_data,
   83|   609k|                                        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.30k|      const int src_offset = (p - 1) * num_components;
   88|  3.30k|      this->transform().ComputeOriginalValue(
   89|  3.30k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   90|   606k|    } else {
   91|       |      // Apply the parallelogram prediction.
   92|   606k|      this->transform().ComputeOriginalValue(
   93|   606k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   94|   606k|    }
   95|   609k|  }
   96|    682|  return true;
   97|    682|}

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  5.42M|    int num_components, DataTypeT* out_prediction) {
   49|  5.42M|  const CornerIndex oci = table->Opposite(ci);
   50|  5.42M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 4.36M, False: 1.05M]
  ------------------
   51|  4.36M|    return false;
   52|  4.36M|  }
   53|  1.05M|  int vert_opp, vert_next, vert_prev;
   54|  1.05M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.05M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.05M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 549k, False: 506k]
  |  Branch (56:35): [True: 417k, False: 132k]
  ------------------
   57|   417k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 389k, False: 27.5k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   389k|    const int v_opp_off = vert_opp * num_components;
   60|   389k|    const int v_next_off = vert_next * num_components;
   61|   389k|    const int v_prev_off = vert_prev * num_components;
   62|  32.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 32.2M, False: 389k]
  ------------------
   63|  32.2M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  32.2M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  32.2M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  32.2M|      const int64_t result =
   67|  32.2M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  32.2M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  32.2M|    }
   71|   389k|    return true;
   72|   389k|  }
   73|   666k|  return false;  // Not all data is available for prediction
   74|  1.05M|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.05M|    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|  1.05M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.05M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.05M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.05M|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  6.71M|    int num_components, DataTypeT* out_prediction) {
   49|  6.71M|  const CornerIndex oci = table->Opposite(ci);
   50|  6.71M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 24.4k, False: 6.68M]
  ------------------
   51|  24.4k|    return false;
   52|  24.4k|  }
   53|  6.68M|  int vert_opp, vert_next, vert_prev;
   54|  6.68M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  6.68M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  6.68M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 3.62M, False: 3.06M]
  |  Branch (56:35): [True: 2.79M, False: 823k]
  ------------------
   57|  2.79M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.61M, False: 187k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.61M|    const int v_opp_off = vert_opp * num_components;
   60|  2.61M|    const int v_next_off = vert_next * num_components;
   61|  2.61M|    const int v_prev_off = vert_prev * num_components;
   62|  96.5M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 93.9M, False: 2.61M]
  ------------------
   63|  93.9M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  93.9M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  93.9M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  93.9M|      const int64_t result =
   67|  93.9M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  93.9M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  93.9M|    }
   71|  2.61M|    return true;
   72|  2.61M|  }
   73|  4.07M|  return false;  // Not all data is available for prediction
   74|  6.68M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  6.68M|    int* next_entry, int* prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  6.68M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  6.68M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  6.68M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  6.68M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    210|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    210|            attribute, transform, mesh_data),
   46|    210|        pos_attribute_(nullptr),
   47|    210|        entry_to_point_id_map_(nullptr),
   48|    210|        num_components_(0),
   49|    210|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|    417|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|    210|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    210|    DRACO_DCHECK_EQ(i, 0);
   75|    210|    (void)i;
   76|    210|    return GeometryAttribute::POSITION;
   77|    210|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    210|  bool SetParentAttribute(const PointAttribute* att) override {
   80|    210|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 210]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    210|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 210]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    210|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 3, False: 207]
  ------------------
   87|      3|      return false;  // Currently works only for 3 component positions.
   88|      3|    }
   89|    207|    pos_attribute_ = att;
   90|    207|    return true;
   91|    210|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  156|    202|    DecodePredictionData(DecoderBuffer* buffer) {
  157|       |  // Decode the delta coded orientations.
  158|    202|  uint32_t num_orientations = 0;
  159|    202|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    202|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (159:7): [True: 5, False: 197]
  ------------------
  160|      5|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (160:9): [True: 0, False: 5]
  ------------------
  161|      0|      return false;
  162|      0|    }
  163|    197|  } else {
  164|    197|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (164:9): [True: 1, False: 196]
  ------------------
  165|      1|      return false;
  166|      1|    }
  167|    197|  }
  168|    201|  if (num_orientations == 0) {
  ------------------
  |  Branch (168:7): [True: 1, False: 200]
  ------------------
  169|      1|    return false;
  170|      1|  }
  171|    200|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (171:7): [True: 14, False: 186]
  ------------------
  172|       |    // We can't have more orientations than the maximum number of decoded
  173|       |    // values.
  174|     14|    return false;
  175|     14|  }
  176|    186|  orientations_.resize(num_orientations);
  177|    186|  bool last_orientation = true;
  178|    186|  RAnsBitDecoder decoder;
  179|    186|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (179:7): [True: 2, False: 184]
  ------------------
  180|      2|    return false;
  181|      2|  }
  182|  86.9k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (182:24): [True: 86.7k, False: 184]
  ------------------
  183|  86.7k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (183:9): [True: 1.26k, False: 85.4k]
  ------------------
  184|  1.26k|      last_orientation = !last_orientation;
  185|  1.26k|    }
  186|  86.7k|    orientations_[i] = last_orientation;
  187|  86.7k|  }
  188|    184|  decoder.EndDecoding();
  189|    184|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  190|    184|                                     MeshDataT>::DecodePredictionData(buffer);
  191|    186|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|    131|                          const PointIndex* entry_to_point_id_map) {
  126|    131|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 8, False: 123]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      8|    return false;
  129|      8|  }
  130|    123|  num_components_ = num_components;
  131|    123|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|    123|  predicted_value_ =
  133|    123|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|    123|  this->transform().Init(num_components);
  135|       |
  136|    123|  const int corner_map_size =
  137|    123|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|    123|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (138:7): [True: 0, False: 123]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|  1.34M|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (141:19): [True: 1.34M, False: 90]
  ------------------
  142|  1.34M|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  143|  1.34M|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (143:9): [True: 33, False: 1.34M]
  ------------------
  144|     33|      return false;
  145|     33|    }
  146|       |
  147|  1.34M|    const int dst_offset = p * num_components;
  148|  1.34M|    this->transform().ComputeOriginalValue(
  149|  1.34M|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  150|  1.34M|  }
  151|     90|  return true;
  152|    123|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  196|  1.34M|                          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|  1.34M|  const CornerIndex next_corner_id =
  201|  1.34M|      this->mesh_data().corner_table()->Next(corner_id);
  202|  1.34M|  const CornerIndex prev_corner_id =
  203|  1.34M|      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|  1.34M|  int next_data_id, prev_data_id;
  207|       |
  208|  1.34M|  int next_vert_id, prev_vert_id;
  209|  1.34M|  next_vert_id =
  210|  1.34M|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  211|  1.34M|  prev_vert_id =
  212|  1.34M|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  213|       |
  214|  1.34M|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  215|  1.34M|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  216|       |
  217|  1.34M|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (217:7): [True: 919k, False: 426k]
  |  Branch (217:33): [True: 492k, False: 426k]
  ------------------
  218|       |    // Both other corners have available UV coordinates for prediction.
  219|   492k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  220|   492k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  221|   492k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (221:9): [True: 485k, False: 7.65k]
  ------------------
  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|   970k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (225:24): [True: 970k, False: 485k]
  ------------------
  226|   970k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (226:13): [True: 0, False: 970k]
  |  Branch (226:36): [True: 103, False: 970k]
  ------------------
  227|   970k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (227:13): [True: 0, False: 970k]
  ------------------
  228|    103|          predicted_value_[i] = INT_MIN;
  229|   970k|        } else {
  230|   970k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  231|   970k|        }
  232|   970k|      }
  233|   485k|      return true;
  234|   485k|    }
  235|       |
  236|       |    // Get positions at all corners.
  237|  7.65k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  238|  7.65k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  239|  7.65k|    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|  7.65k|    const Vector3f pn = prev_pos - next_pos;
  264|  7.65k|    const Vector3f cn = tip_pos - next_pos;
  265|  7.65k|    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|  7.65k|    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|  7.65k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  15.3k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (276:9): [True: 0, False: 7.65k]
  |  Branch (276:53): [True: 285, False: 7.37k]
  ------------------
  277|    285|      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|    285|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  282|  7.37k|    } else {
  283|  7.37k|      s = 0;
  284|  7.37k|      t = 0;
  285|  7.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|  7.65k|    const Vector2f pn_uv = p_uv - n_uv;
  302|  7.65k|    const float pnus = pn_uv[0] * s + n_uv[0];
  303|  7.65k|    const float pnut = pn_uv[0] * t;
  304|  7.65k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  305|  7.65k|    const float pnvt = pn_uv[1] * t;
  306|  7.65k|    Vector2f predicted_uv;
  307|  7.65k|    if (orientations_.empty()) {
  ------------------
  |  Branch (307:9): [True: 33, False: 7.62k]
  ------------------
  308|     33|      return false;
  309|     33|    }
  310|       |
  311|       |    // When decoding the data, we already know which orientation to use.
  312|  7.62k|    const bool orientation = orientations_.back();
  313|  7.62k|    orientations_.pop_back();
  314|  7.62k|    if (orientation) {
  ------------------
  |  Branch (314:9): [True: 1.68k, False: 5.94k]
  ------------------
  315|  1.68k|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  316|  5.94k|    } else {
  317|  5.94k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  318|  5.94k|    }
  319|  7.62k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (319:9): [True: 7.62k, 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|  7.62k|      const double u = floor(predicted_uv[0] + 0.5);
  324|  7.62k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (324:11): [True: 0, False: 7.62k]
  |  Branch (324:28): [True: 91, False: 7.53k]
  |  Branch (324:43): [True: 40, False: 7.49k]
  ------------------
  325|    131|        predicted_value_[0] = INT_MIN;
  326|  7.49k|      } else {
  327|  7.49k|        predicted_value_[0] = static_cast<int>(u);
  328|  7.49k|      }
  329|  7.62k|      const double v = floor(predicted_uv[1] + 0.5);
  330|  7.62k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (330:11): [True: 0, False: 7.62k]
  |  Branch (330:28): [True: 61, False: 7.56k]
  |  Branch (330:43): [True: 48, False: 7.51k]
  ------------------
  331|    109|        predicted_value_[1] = INT_MIN;
  332|  7.51k|      } else {
  333|  7.51k|        predicted_value_[1] = static_cast<int>(v);
  334|  7.51k|      }
  335|  7.62k|    } 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|  7.62k|    return true;
  341|  7.65k|  }
  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|   853k|  int data_offset = 0;
  346|   853k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (346:7): [True: 426k, False: 426k]
  ------------------
  347|       |    // Use the value on the previous corner as the prediction.
  348|   426k|    data_offset = prev_data_id * num_components_;
  349|   426k|  }
  350|   853k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (350:7): [True: 23, False: 853k]
  ------------------
  351|       |    // Use the value on the next corner as the prediction.
  352|     23|    data_offset = next_data_id * num_components_;
  353|   853k|  } else {
  354|       |    // None of the other corners have a valid value. Use the last encoded value
  355|       |    // as the prediction if possible.
  356|   853k|    if (data_id > 0) {
  ------------------
  |  Branch (356:9): [True: 852k, False: 123]
  ------------------
  357|   852k|      data_offset = (data_id - 1) * num_components_;
  358|   852k|    } else {
  359|       |      // We are encoding the first value. Predict 0.
  360|    369|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (360:23): [True: 246, False: 123]
  ------------------
  361|    246|        predicted_value_[i] = 0;
  362|    246|      }
  363|    123|      return true;
  364|    123|    }
  365|   853k|  }
  366|  2.55M|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (366:19): [True: 1.70M, False: 852k]
  ------------------
  367|  1.70M|    predicted_value_[i] = data[data_offset + i];
  368|  1.70M|  }
  369|   852k|  return true;
  370|   853k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   985k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT* data) const {
  103|   985k|    const int data_offset = entry_id * num_components_;
  104|   985k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   985k|                    static_cast<float>(data[data_offset + 1]));
  106|   985k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  22.9k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  22.9k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  22.9k|    Vector3f pos;
   97|  22.9k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  22.9k|                                 &pos[0]);
   99|  22.9k|    return pos;
  100|  22.9k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    229|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    229|            attribute, transform, mesh_data),
   46|    229|        pos_attribute_(nullptr),
   47|    229|        entry_to_point_id_map_(nullptr),
   48|    229|        num_components_(0),
   49|    229|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|    455|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|    229|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    229|    DRACO_DCHECK_EQ(i, 0);
   75|    229|    (void)i;
   76|    229|    return GeometryAttribute::POSITION;
   77|    229|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    228|  bool SetParentAttribute(const PointAttribute* att) override {
   80|    228|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 228]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    228|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 228]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    228|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 2, False: 226]
  ------------------
   87|      2|      return false;  // Currently works only for 3 component positions.
   88|      2|    }
   89|    226|    pos_attribute_ = att;
   90|    226|    return true;
   91|    228|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  156|    221|    DecodePredictionData(DecoderBuffer* buffer) {
  157|       |  // Decode the delta coded orientations.
  158|    221|  uint32_t num_orientations = 0;
  159|    221|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    221|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (159:7): [True: 5, False: 216]
  ------------------
  160|      5|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (160:9): [True: 0, False: 5]
  ------------------
  161|      0|      return false;
  162|      0|    }
  163|    216|  } else {
  164|    216|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (164:9): [True: 1, False: 215]
  ------------------
  165|      1|      return false;
  166|      1|    }
  167|    216|  }
  168|    220|  if (num_orientations == 0) {
  ------------------
  |  Branch (168:7): [True: 2, False: 218]
  ------------------
  169|      2|    return false;
  170|      2|  }
  171|    218|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (171:7): [True: 49, False: 169]
  ------------------
  172|       |    // We can't have more orientations than the maximum number of decoded
  173|       |    // values.
  174|     49|    return false;
  175|     49|  }
  176|    169|  orientations_.resize(num_orientations);
  177|    169|  bool last_orientation = true;
  178|    169|  RAnsBitDecoder decoder;
  179|    169|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (179:7): [True: 2, False: 167]
  ------------------
  180|      2|    return false;
  181|      2|  }
  182|  31.9k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (182:24): [True: 31.7k, False: 167]
  ------------------
  183|  31.7k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (183:9): [True: 5.76k, False: 26.0k]
  ------------------
  184|  5.76k|      last_orientation = !last_orientation;
  185|  5.76k|    }
  186|  31.7k|    orientations_[i] = last_orientation;
  187|  31.7k|  }
  188|    167|  decoder.EndDecoding();
  189|    167|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  190|    167|                                     MeshDataT>::DecodePredictionData(buffer);
  191|    169|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|    126|                          const PointIndex* entry_to_point_id_map) {
  126|    126|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 1, False: 125]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      1|    return false;
  129|      1|  }
  130|    125|  num_components_ = num_components;
  131|    125|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|    125|  predicted_value_ =
  133|    125|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|    125|  this->transform().Init(num_components);
  135|       |
  136|    125|  const int corner_map_size =
  137|    125|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|    125|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (138:7): [True: 0, False: 125]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|   227k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (141:19): [True: 226k, False: 95]
  ------------------
  142|   226k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  143|   226k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (143:9): [True: 30, False: 226k]
  ------------------
  144|     30|      return false;
  145|     30|    }
  146|       |
  147|   226k|    const int dst_offset = p * num_components;
  148|   226k|    this->transform().ComputeOriginalValue(
  149|   226k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  150|   226k|  }
  151|     95|  return true;
  152|    125|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  196|   226k|                          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|   226k|  const CornerIndex next_corner_id =
  201|   226k|      this->mesh_data().corner_table()->Next(corner_id);
  202|   226k|  const CornerIndex prev_corner_id =
  203|   226k|      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|   226k|  int next_data_id, prev_data_id;
  207|       |
  208|   226k|  int next_vert_id, prev_vert_id;
  209|   226k|  next_vert_id =
  210|   226k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  211|   226k|  prev_vert_id =
  212|   226k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  213|       |
  214|   226k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  215|   226k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  216|       |
  217|   226k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (217:7): [True: 226k, False: 300]
  |  Branch (217:33): [True: 226k, False: 278]
  ------------------
  218|       |    // Both other corners have available UV coordinates for prediction.
  219|   226k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  220|   226k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  221|   226k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (221:9): [True: 223k, False: 2.74k]
  ------------------
  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|   447k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (225:24): [True: 447k, False: 223k]
  ------------------
  226|   447k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (226:13): [True: 0, False: 447k]
  |  Branch (226:36): [True: 122, False: 447k]
  ------------------
  227|   447k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (227:13): [True: 0, False: 447k]
  ------------------
  228|    122|          predicted_value_[i] = INT_MIN;
  229|   447k|        } else {
  230|   447k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  231|   447k|        }
  232|   447k|      }
  233|   223k|      return true;
  234|   223k|    }
  235|       |
  236|       |    // Get positions at all corners.
  237|  2.74k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  238|  2.74k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  239|  2.74k|    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|  2.74k|    const Vector3f pn = prev_pos - next_pos;
  264|  2.74k|    const Vector3f cn = tip_pos - next_pos;
  265|  2.74k|    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|  2.74k|    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|  2.74k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  5.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (276:9): [True: 0, False: 2.74k]
  |  Branch (276:53): [True: 467, False: 2.27k]
  ------------------
  277|    467|      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|    467|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  282|  2.27k|    } else {
  283|  2.27k|      s = 0;
  284|  2.27k|      t = 0;
  285|  2.27k|    }
  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|  2.74k|    const Vector2f pn_uv = p_uv - n_uv;
  302|  2.74k|    const float pnus = pn_uv[0] * s + n_uv[0];
  303|  2.74k|    const float pnut = pn_uv[0] * t;
  304|  2.74k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  305|  2.74k|    const float pnvt = pn_uv[1] * t;
  306|  2.74k|    Vector2f predicted_uv;
  307|  2.74k|    if (orientations_.empty()) {
  ------------------
  |  Branch (307:9): [True: 30, False: 2.71k]
  ------------------
  308|     30|      return false;
  309|     30|    }
  310|       |
  311|       |    // When decoding the data, we already know which orientation to use.
  312|  2.71k|    const bool orientation = orientations_.back();
  313|  2.71k|    orientations_.pop_back();
  314|  2.71k|    if (orientation) {
  ------------------
  |  Branch (314:9): [True: 1.52k, False: 1.19k]
  ------------------
  315|  1.52k|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  316|  1.52k|    } else {
  317|  1.19k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  318|  1.19k|    }
  319|  2.71k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (319:9): [True: 2.71k, 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|  2.71k|      const double u = floor(predicted_uv[0] + 0.5);
  324|  2.71k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (324:11): [True: 0, False: 2.71k]
  |  Branch (324:28): [True: 102, False: 2.61k]
  |  Branch (324:43): [True: 51, False: 2.56k]
  ------------------
  325|    153|        predicted_value_[0] = INT_MIN;
  326|  2.56k|      } else {
  327|  2.56k|        predicted_value_[0] = static_cast<int>(u);
  328|  2.56k|      }
  329|  2.71k|      const double v = floor(predicted_uv[1] + 0.5);
  330|  2.71k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (330:11): [True: 0, False: 2.71k]
  |  Branch (330:28): [True: 128, False: 2.58k]
  |  Branch (330:43): [True: 34, False: 2.55k]
  ------------------
  331|    162|        predicted_value_[1] = INT_MIN;
  332|  2.55k|      } else {
  333|  2.55k|        predicted_value_[1] = static_cast<int>(v);
  334|  2.55k|      }
  335|  2.71k|    } 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|  2.71k|    return true;
  341|  2.74k|  }
  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|    578|  int data_offset = 0;
  346|    578|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (346:7): [True: 278, False: 300]
  ------------------
  347|       |    // Use the value on the previous corner as the prediction.
  348|    278|    data_offset = prev_data_id * num_components_;
  349|    278|  }
  350|    578|  if (next_data_id < data_id) {
  ------------------
  |  Branch (350:7): [True: 25, False: 553]
  ------------------
  351|       |    // Use the value on the next corner as the prediction.
  352|     25|    data_offset = next_data_id * num_components_;
  353|    553|  } else {
  354|       |    // None of the other corners have a valid value. Use the last encoded value
  355|       |    // as the prediction if possible.
  356|    553|    if (data_id > 0) {
  ------------------
  |  Branch (356:9): [True: 428, False: 125]
  ------------------
  357|    428|      data_offset = (data_id - 1) * num_components_;
  358|    428|    } else {
  359|       |      // We are encoding the first value. Predict 0.
  360|    375|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (360:23): [True: 250, False: 125]
  ------------------
  361|    250|        predicted_value_[i] = 0;
  362|    250|      }
  363|    125|      return true;
  364|    125|    }
  365|    553|  }
  366|  1.35k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (366:19): [True: 906, False: 453]
  ------------------
  367|    906|    predicted_value_[i] = data[data_offset + i];
  368|    906|  }
  369|    453|  return true;
  370|    578|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   452k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT* data) const {
  103|   452k|    const int data_offset = entry_id * num_components_;
  104|   452k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   452k|                    static_cast<float>(data[data_offset + 1]));
  106|   452k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  8.22k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  8.22k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  8.22k|    Vector3f pos;
   97|  8.22k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  8.22k|                                 &pos[0]);
   99|  8.22k|    return pos;
  100|  8.22k|  }

_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    262|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   39|    262|            attribute, transform, mesh_data),
   40|    262|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   62|    522|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   64|    262|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   65|    262|    DRACO_DCHECK_EQ(i, 0);
   66|    262|    (void)i;
   67|    262|    return GeometryAttribute::POSITION;
   68|    262|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   70|    261|  bool SetParentAttribute(const PointAttribute* att) override {
   71|    261|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (71:9): [True: 0, False: 261]
  |  Branch (71:17): [True: 0, False: 261]
  ------------------
   72|      0|      return false;  // Invalid attribute type.
   73|      0|    }
   74|    261|    if (att->num_components() != 3) {
  ------------------
  |  Branch (74:9): [True: 1, False: 260]
  ------------------
   75|      1|      return false;  // Currently works only for 3 component positions.
   76|      1|    }
   77|    260|    predictor_.SetPositionAttribute(*att);
   78|    260|    return true;
   79|    261|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  128|    257|                                                                buffer) {
  129|       |  // Decode the delta coded orientations.
  130|    257|  int32_t num_orientations = 0;
  131|    257|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (131:7): [True: 1, False: 256]
  |  Branch (131:45): [True: 11, False: 245]
  ------------------
  132|     12|    return false;
  133|     12|  }
  134|       |
  135|       |  // Check that the decoded number of orientations is not unreasonably high.
  136|    245|  const int32_t max_num_orientations = max_num_predicted_values_;
  137|    245|  if (max_num_orientations != -1 && num_orientations > max_num_orientations) {
  ------------------
  |  Branch (137:7): [True: 245, False: 0]
  |  Branch (137:37): [True: 26, False: 219]
  ------------------
  138|     26|    return false;
  139|     26|  }
  140|       |
  141|    219|  predictor_.ResizeOrientations(num_orientations);
  142|    219|  bool last_orientation = true;
  143|    219|  RAnsBitDecoder decoder;
  144|    219|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (144:7): [True: 6, False: 213]
  ------------------
  145|      6|    return false;
  146|      6|  }
  147|  64.2k|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (147:19): [True: 64.0k, False: 213]
  ------------------
  148|  64.0k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (148:9): [True: 2.60k, False: 61.4k]
  ------------------
  149|  2.60k|      last_orientation = !last_orientation;
  150|  2.60k|    }
  151|  64.0k|    predictor_.set_orientation(i, last_orientation);
  152|  64.0k|  }
  153|    213|  decoder.EndDecoding();
  154|    213|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  155|    213|                                     MeshDataT>::DecodePredictionData(buffer);
  156|    219|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE24SetMaxNumPredictedValuesEi:
   81|    257|  virtual void SetMaxNumPredictedValues(int32_t num) {
   82|    257|    max_num_predicted_values_ = num;
   83|    257|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   97|    178|                                      const PointIndex* entry_to_point_id_map) {
   98|    178|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (98:7): [True: 3, False: 175]
  ------------------
   99|    178|                            DataTypeT, MeshDataT>::kNumComponents) {
  100|      3|    return false;
  101|      3|  }
  102|    175|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  103|    175|  this->transform().Init(num_components);
  104|       |
  105|    175|  const int corner_map_size =
  106|    175|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  107|    175|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (107:7): [True: 0, False: 175]
  ------------------
  108|      0|    return false;
  109|      0|  }
  110|   814k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 814k, False: 118]
  ------------------
  111|   814k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  112|   814k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (112:9): [True: 57, False: 814k]
  ------------------
  113|   814k|                                                          p)) {
  114|     57|      return false;
  115|     57|    }
  116|       |
  117|   814k|    const int dst_offset = p * num_components;
  118|   814k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  119|   814k|                                           in_corr + dst_offset,
  120|   814k|                                           out_data + dst_offset);
  121|   814k|  }
  122|    118|  return true;
  123|    175|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    262|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   39|    262|            attribute, transform, mesh_data),
   40|    262|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   62|    521|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   64|    262|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   65|    262|    DRACO_DCHECK_EQ(i, 0);
   66|    262|    (void)i;
   67|    262|    return GeometryAttribute::POSITION;
   68|    262|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   70|    260|  bool SetParentAttribute(const PointAttribute* att) override {
   71|    260|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (71:9): [True: 0, False: 260]
  |  Branch (71:17): [True: 0, False: 260]
  ------------------
   72|      0|      return false;  // Invalid attribute type.
   73|      0|    }
   74|    260|    if (att->num_components() != 3) {
  ------------------
  |  Branch (74:9): [True: 1, False: 259]
  ------------------
   75|      1|      return false;  // Currently works only for 3 component positions.
   76|      1|    }
   77|    259|    predictor_.SetPositionAttribute(*att);
   78|    259|    return true;
   79|    260|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  128|    254|                                                                buffer) {
  129|       |  // Decode the delta coded orientations.
  130|    254|  int32_t num_orientations = 0;
  131|    254|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (131:7): [True: 1, False: 253]
  |  Branch (131:45): [True: 26, False: 227]
  ------------------
  132|     27|    return false;
  133|     27|  }
  134|       |
  135|       |  // Check that the decoded number of orientations is not unreasonably high.
  136|    227|  const int32_t max_num_orientations = max_num_predicted_values_;
  137|    227|  if (max_num_orientations != -1 && num_orientations > max_num_orientations) {
  ------------------
  |  Branch (137:7): [True: 227, False: 0]
  |  Branch (137:37): [True: 26, False: 201]
  ------------------
  138|     26|    return false;
  139|     26|  }
  140|       |
  141|    201|  predictor_.ResizeOrientations(num_orientations);
  142|    201|  bool last_orientation = true;
  143|    201|  RAnsBitDecoder decoder;
  144|    201|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (144:7): [True: 1, False: 200]
  ------------------
  145|      1|    return false;
  146|      1|  }
  147|   186k|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (147:19): [True: 186k, False: 200]
  ------------------
  148|   186k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (148:9): [True: 11.4k, False: 174k]
  ------------------
  149|  11.4k|      last_orientation = !last_orientation;
  150|  11.4k|    }
  151|   186k|    predictor_.set_orientation(i, last_orientation);
  152|   186k|  }
  153|    200|  decoder.EndDecoding();
  154|    200|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  155|    200|                                     MeshDataT>::DecodePredictionData(buffer);
  156|    201|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE24SetMaxNumPredictedValuesEi:
   81|    254|  virtual void SetMaxNumPredictedValues(int32_t num) {
   82|    254|    max_num_predicted_values_ = num;
   83|    254|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   97|    181|                                      const PointIndex* entry_to_point_id_map) {
   98|    181|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (98:7): [True: 6, False: 175]
  ------------------
   99|    181|                            DataTypeT, MeshDataT>::kNumComponents) {
  100|      6|    return false;
  101|      6|  }
  102|    175|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  103|    175|  this->transform().Init(num_components);
  104|       |
  105|    175|  const int corner_map_size =
  106|    175|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  107|    175|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (107:7): [True: 0, False: 175]
  ------------------
  108|      0|    return false;
  109|      0|  }
  110|   339k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 339k, False: 87]
  ------------------
  111|   339k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  112|   339k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (112:9): [True: 88, False: 339k]
  ------------------
  113|   339k|                                                          p)) {
  114|     88|      return false;
  115|     88|    }
  116|       |
  117|   339k|    const int dst_offset = p * num_components;
  118|   339k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  119|   339k|                                           in_corr + dst_offset,
  120|   339k|                                           out_data + dst_offset);
  121|   339k|  }
  122|     87|  return true;
  123|    175|}

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    262|      : pos_attribute_(nullptr),
   39|    262|        entry_to_point_id_map_(nullptr),
   40|    262|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    260|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    260|    pos_attribute_ = &position_attribute;
   43|    260|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    219|  void ResizeOrientations(int num_orientations) {
   74|    219|    orientations_.resize(num_orientations);
   75|    219|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  64.0k|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    175|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    175|    entry_to_point_id_map_ = map;
   46|    175|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   814k|                                                 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|   814k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   814k|  const CornerIndex prev_corner_id =
   99|   814k|      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|   814k|  int next_data_id, prev_data_id;
  103|       |
  104|   814k|  int next_vert_id, prev_vert_id;
  105|   814k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   814k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   814k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   814k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   814k|  typedef VectorD<int64_t, 2> Vec2;
  112|   814k|  typedef VectorD<int64_t, 3> Vec3;
  113|   814k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   814k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 558k, False: 255k]
  |  Branch (115:33): [True: 302k, False: 255k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   302k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   302k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   302k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 282k, False: 20.1k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   282k|      predicted_value_[0] = p_uv[0];
  122|   282k|      predicted_value_[1] = p_uv[1];
  123|   282k|      return true;
  124|   282k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  20.1k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  20.1k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  20.1k|    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|  20.1k|    const Vec3 pn = prev_pos - next_pos;
  146|  20.1k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  20.1k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.00k, False: 19.0k]
  ------------------
  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.00k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.00k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.00k|      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.00k|      const int64_t n_uv_absmax_element =
  164|  1.00k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.00k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 20, False: 988]
  ------------------
  166|  1.00k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     20|        return false;
  169|     20|      }
  170|    988|      const int64_t pn_uv_absmax_element =
  171|    988|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    988|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 4, False: 984]
  ------------------
  173|    988|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      4|        return false;
  176|      4|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.
  178|    984|      const Vec2 x_uv = Vec2(Vec2u(n_uv) * pn_norm2_squared +
  179|    984|                             Vec2u(pn_uv) * static_cast<uint64_t>(cn_dot_pn));
  180|    984|      const int64_t pn_absmax_element =
  181|    984|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  182|    984|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (182:11): [True: 3, False: 981]
  ------------------
  183|    984|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  184|       |        // Return false if squared length calculation would overflow.
  185|      3|        return false;
  186|      3|      }
  187|       |
  188|       |      // Compute squared length of vector CX in position coordinate system:
  189|    981|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  190|    981|      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|    981|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  207|       |      // Compute CX.Norm2() * PN.Norm2()
  208|    981|      const uint64_t norm_squared =
  209|    981|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  210|       |      // Final cx_uv in the scaled coordinate space.
  211|    981|      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|    981|      Vec2 predicted_uv;
  216|    981|      if (is_encoder_t) {
  ------------------
  |  Branch (216:11): [Folded, False: 981]
  ------------------
  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|    981|      } else {
  233|       |        // When decoding the data, we already know which orientation to use.
  234|    981|        if (orientations_.empty()) {
  ------------------
  |  Branch (234:13): [True: 30, False: 951]
  ------------------
  235|     30|          return false;
  236|     30|        }
  237|    951|        const bool orientation = orientations_.back();
  238|    951|        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|    951|        if (orientation) {
  ------------------
  |  Branch (241:13): [True: 548, False: 403]
  ------------------
  242|    548|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  243|    548|        } else {
  244|    403|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  245|    403|        }
  246|    951|      }
  247|    951|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  248|    951|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  249|    951|      return true;
  250|    981|    }
  251|  20.1k|  }
  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|   530k|  int data_offset = 0;
  256|   530k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (256:7): [True: 274k, False: 255k]
  ------------------
  257|       |    // Use the value on the previous corner as the prediction.
  258|   274k|    data_offset = prev_data_id * kNumComponents;
  259|   274k|  }
  260|   530k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (260:7): [True: 19.0k, False: 511k]
  ------------------
  261|       |    // Use the value on the next corner as the prediction.
  262|  19.0k|    data_offset = next_data_id * kNumComponents;
  263|   511k|  } else {
  264|       |    // None of the other corners have a valid value. Use the last encoded value
  265|       |    // as the prediction if possible.
  266|   511k|    if (data_id > 0) {
  ------------------
  |  Branch (266:9): [True: 511k, False: 175]
  ------------------
  267|   511k|      data_offset = (data_id - 1) * kNumComponents;
  268|   511k|    } else {
  269|       |      // We are encoding the first value. Predict 0.
  270|    525|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (270:23): [True: 350, False: 175]
  ------------------
  271|    350|        predicted_value_[i] = 0;
  272|    350|      }
  273|    175|      return true;
  274|    175|    }
  275|   511k|  }
  276|  1.59M|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:19): [True: 1.06M, False: 530k]
  ------------------
  277|  1.06M|    predicted_value_[i] = data[data_offset + i];
  278|  1.06M|  }
  279|   530k|  return true;
  280|   530k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   605k|                                            const DataTypeT* data) const {
   59|   605k|    const int data_offset = entry_id * kNumComponents;
   60|   605k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   605k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  60.3k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  60.3k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  60.3k|    VectorD<int64_t, 3> pos;
   52|  60.3k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  60.3k|                                 &pos[0]);
   54|  60.3k|    return pos;
   55|  60.3k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   814k|  const DataTypeT* predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    262|      : pos_attribute_(nullptr),
   39|    262|        entry_to_point_id_map_(nullptr),
   40|    262|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    259|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    259|    pos_attribute_ = &position_attribute;
   43|    259|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    201|  void ResizeOrientations(int num_orientations) {
   74|    201|    orientations_.resize(num_orientations);
   75|    201|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|   186k|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    175|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    175|    entry_to_point_id_map_ = map;
   46|    175|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   339k|                                                 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|   339k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   339k|  const CornerIndex prev_corner_id =
   99|   339k|      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|   339k|  int next_data_id, prev_data_id;
  103|       |
  104|   339k|  int next_vert_id, prev_vert_id;
  105|   339k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   339k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   339k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   339k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   339k|  typedef VectorD<int64_t, 2> Vec2;
  112|   339k|  typedef VectorD<int64_t, 3> Vec3;
  113|   339k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   339k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 339k, False: 263]
  |  Branch (115:33): [True: 339k, False: 262]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   339k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   339k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   339k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 304k, False: 34.4k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   304k|      predicted_value_[0] = p_uv[0];
  122|   304k|      predicted_value_[1] = p_uv[1];
  123|   304k|      return true;
  124|   304k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  34.4k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  34.4k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  34.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|  34.4k|    const Vec3 pn = prev_pos - next_pos;
  146|  34.4k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  34.4k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 213, False: 34.2k]
  ------------------
  148|       |      // Compute the projection of C onto PN by computing dot product of CN with
  149|       |      // PN and normalizing it by length of PN. This gives us a factor |s| where
  150|       |      // |s = PN.Dot(CN) / PN.SquaredNorm2()|. This factor can be used to
  151|       |      // compute X in UV space |X_UV| as |X_UV = N_UV + s * PN_UV|.
  152|    213|      const Vec3 cn = tip_pos - next_pos;
  153|    213|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    213|      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|    213|      const int64_t n_uv_absmax_element =
  164|    213|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    213|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 20, False: 193]
  ------------------
  166|    213|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     20|        return false;
  169|     20|      }
  170|    193|      const int64_t pn_uv_absmax_element =
  171|    193|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    193|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 7, False: 186]
  ------------------
  173|    193|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      7|        return false;
  176|      7|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.
  178|    186|      const Vec2 x_uv = Vec2(Vec2u(n_uv) * pn_norm2_squared +
  179|    186|                             Vec2u(pn_uv) * static_cast<uint64_t>(cn_dot_pn));
  180|    186|      const int64_t pn_absmax_element =
  181|    186|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  182|    186|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (182:11): [True: 7, False: 179]
  ------------------
  183|    186|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  184|       |        // Return false if squared length calculation would overflow.
  185|      7|        return false;
  186|      7|      }
  187|       |
  188|       |      // Compute squared length of vector CX in position coordinate system:
  189|    179|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  190|    179|      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|    179|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  207|       |      // Compute CX.Norm2() * PN.Norm2()
  208|    179|      const uint64_t norm_squared =
  209|    179|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  210|       |      // Final cx_uv in the scaled coordinate space.
  211|    179|      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|    179|      Vec2 predicted_uv;
  216|    179|      if (is_encoder_t) {
  ------------------
  |  Branch (216:11): [Folded, False: 179]
  ------------------
  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|    179|      } else {
  233|       |        // When decoding the data, we already know which orientation to use.
  234|    179|        if (orientations_.empty()) {
  ------------------
  |  Branch (234:13): [True: 54, False: 125]
  ------------------
  235|     54|          return false;
  236|     54|        }
  237|    125|        const bool orientation = orientations_.back();
  238|    125|        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|    125|        if (orientation) {
  ------------------
  |  Branch (241:13): [True: 91, False: 34]
  ------------------
  242|     91|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  243|     91|        } else {
  244|     34|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  245|     34|        }
  246|    125|      }
  247|    125|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  248|    125|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  249|    125|      return true;
  250|    179|    }
  251|  34.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|  34.8k|  int data_offset = 0;
  256|  34.8k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (256:7): [True: 34.5k, False: 263]
  ------------------
  257|       |    // Use the value on the previous corner as the prediction.
  258|  34.5k|    data_offset = prev_data_id * kNumComponents;
  259|  34.5k|  }
  260|  34.8k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (260:7): [True: 34.2k, False: 516]
  ------------------
  261|       |    // Use the value on the next corner as the prediction.
  262|  34.2k|    data_offset = next_data_id * kNumComponents;
  263|  34.2k|  } else {
  264|       |    // None of the other corners have a valid value. Use the last encoded value
  265|       |    // as the prediction if possible.
  266|    516|    if (data_id > 0) {
  ------------------
  |  Branch (266:9): [True: 341, False: 175]
  ------------------
  267|    341|      data_offset = (data_id - 1) * kNumComponents;
  268|    341|    } else {
  269|       |      // We are encoding the first value. Predict 0.
  270|    525|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (270:23): [True: 350, False: 175]
  ------------------
  271|    350|        predicted_value_[i] = 0;
  272|    350|      }
  273|    175|      return true;
  274|    175|    }
  275|    516|  }
  276|   103k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:19): [True: 69.2k, False: 34.6k]
  ------------------
  277|  69.2k|    predicted_value_[i] = data[data_offset + i];
  278|  69.2k|  }
  279|  34.6k|  return true;
  280|  34.8k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   678k|                                            const DataTypeT* data) const {
   59|   678k|    const int data_offset = entry_id * kNumComponents;
   60|   678k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   678k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|   103k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|   103k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|   103k|    VectorD<int64_t, 3> pos;
   52|   103k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|   103k|                                 &pos[0]);
   54|   103k|    return pos;
   55|   103k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   339k|  const DataTypeT* predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     91|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    401|  bool AreCorrectionsPositive() override {
   71|    401|    return transform_.AreCorrectionsPositive();
   72|    401|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     81|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|     81|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 9, False: 72]
  ------------------
   50|      9|      return false;
   51|      9|    }
   52|     72|    return true;
   53|     81|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  20.1M|  inline Transform& transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    169|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    460|  bool AreCorrectionsPositive() override {
   71|    460|    return transform_.AreCorrectionsPositive();
   72|    460|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    159|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|    159|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 22, False: 137]
  ------------------
   50|     22|      return false;
   51|     22|    }
   52|    137|    return true;
   53|    159|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.00M|  inline Transform& transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  5.50k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  3.59k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  5.29k|  bool AreCorrectionsPositive() override {
   71|  5.29k|    return transform_.AreCorrectionsPositive();
   72|  5.29k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  3.95k|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|  3.95k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 265, False: 3.69k]
  ------------------
   50|    265|      return false;
   51|    265|    }
   52|  3.69k|    return true;
   53|  3.95k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  47.0M|  inline Transform& transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    417|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    476|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    417|                                 const PointCloudDecoder* decoder) {
  188|    417|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    417|      method, att_id, decoder, TransformT());
  190|    417|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    417|                                 const TransformT& transform) {
  156|    417|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 417]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    417|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|    417|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 389, False: 28]
  ------------------
  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|    389|    const MeshDecoder* const mesh_decoder =
  167|    389|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|    389|    auto ret = CreateMeshPredictionScheme<
  170|    389|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    389|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    389|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    389|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 326, False: 63]
  ------------------
  174|    326|      return ret;
  175|    326|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    389|  }
  178|       |  // Create delta decoder.
  179|     91|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     91|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    417|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    168|      uint16_t bitstream_version) {
  143|    168|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    168|        method, attribute, transform, mesh_data, bitstream_version);
  145|    168|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    168|        uint16_t bitstream_version) {
  127|    168|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 158, False: 10]
  ------------------
  128|    158|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    158|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    158|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    158|                                                  mesh_data));
  132|    158|      }
  133|     10|      return nullptr;
  134|    168|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    177|      uint16_t bitstream_version) {
  143|    177|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    177|        method, attribute, transform, mesh_data, bitstream_version);
  145|    177|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    177|        uint16_t bitstream_version) {
  127|    177|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 168, False: 9]
  ------------------
  128|    168|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    168|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    168|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    168|                                                  mesh_data));
  132|    168|      }
  133|      9|      return nullptr;
  134|    177|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    476|                                 const PointCloudDecoder* decoder) {
  188|    476|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    476|      method, att_id, decoder, TransformT());
  190|    476|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    476|                                 const TransformT& transform) {
  156|    476|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 476]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    476|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|    476|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 476, False: 0]
  ------------------
  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|    476|    const MeshDecoder* const mesh_decoder =
  167|    476|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|    476|    auto ret = CreateMeshPredictionScheme<
  170|    476|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    476|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    476|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    476|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 307, False: 169]
  ------------------
  174|    307|      return ret;
  175|    307|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    476|  }
  178|       |  // Create delta decoder.
  179|    169|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    169|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    476|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_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_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    172|        uint16_t bitstream_version) {
  111|    172|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 151, False: 21]
  ------------------
  112|    151|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    151|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    151|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    151|                                                  mesh_data));
  116|    151|      }
  117|     21|      return nullptr;
  118|    172|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    168|      uint16_t bitstream_version) {
  143|    168|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    168|        method, attribute, transform, mesh_data, bitstream_version);
  145|    168|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    168|        uint16_t bitstream_version) {
  111|    168|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 156, False: 12]
  ------------------
  112|    156|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    156|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    156|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    156|                                                  mesh_data));
  116|    156|      }
  117|     12|      return nullptr;
  118|    168|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  5.50k|                                 const PointCloudDecoder* decoder) {
  188|  5.50k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  5.50k|      method, att_id, decoder, TransformT());
  190|  5.50k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  5.50k|                                 const TransformT& transform) {
  156|  5.50k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 5.50k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  5.50k|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|  5.50k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 5.48k, False: 12]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|  5.48k|    const MeshDecoder* const mesh_decoder =
  167|  5.48k|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|  5.48k|    auto ret = CreateMeshPredictionScheme<
  170|  5.48k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  5.48k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  5.48k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  5.48k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 5.16k, False: 326]
  ------------------
  174|  5.16k|      return ret;
  175|  5.16k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  5.48k|  }
  178|       |  // Create delta decoder.
  179|    338|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    338|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  5.50k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.32k|      uint16_t bitstream_version) {
  143|  2.32k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.32k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.32k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.32k|        uint16_t bitstream_version) {
   53|  2.32k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 607, False: 1.71k]
  ------------------
   54|    607|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    607|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    607|                                                         MeshDataT>(
   57|    607|                attribute, transform, mesh_data));
   58|    607|      }
   59|  1.71k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.71k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 373, False: 1.34k]
  ------------------
   61|    373|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    373|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    373|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    373|                                                  mesh_data));
   65|    373|      }
   66|  1.34k|#endif
   67|  1.34k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 461, False: 882]
  ------------------
   68|    461|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    461|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    461|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    461|                                                  mesh_data));
   72|    461|      }
   73|    882|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    882|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 210, False: 672]
  ------------------
   75|    210|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    210|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    210|                                                     MeshDataT>(
   78|    210|                attribute, transform, mesh_data, bitstream_version));
   79|    210|      }
   80|    672|#endif
   81|    672|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 262, False: 410]
  ------------------
   82|    262|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    262|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    262|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    262|                                                  mesh_data));
   86|    262|      }
   87|    410|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    410|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 410, False: 0]
  ------------------
   89|    410|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    410|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    410|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    410|                                                  mesh_data));
   93|    410|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.32k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.84k|      uint16_t bitstream_version) {
  143|  2.84k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.84k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.84k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.84k|        uint16_t bitstream_version) {
   53|  2.84k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 727, False: 2.11k]
  ------------------
   54|    727|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    727|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    727|                                                         MeshDataT>(
   57|    727|                attribute, transform, mesh_data));
   58|    727|      }
   59|  2.11k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.11k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 447, False: 1.66k]
  ------------------
   61|    447|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    447|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    447|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    447|                                                  mesh_data));
   65|    447|      }
   66|  1.66k|#endif
   67|  1.66k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 643, False: 1.02k]
  ------------------
   68|    643|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    643|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    643|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    643|                                                  mesh_data));
   72|    643|      }
   73|  1.02k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|  1.02k|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 229, False: 794]
  ------------------
   75|    229|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    229|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    229|                                                     MeshDataT>(
   78|    229|                attribute, transform, mesh_data, bitstream_version));
   79|    229|      }
   80|    794|#endif
   81|    794|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 262, False: 532]
  ------------------
   82|    262|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    262|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    262|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    262|                                                  mesh_data));
   86|    262|      }
   87|    532|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    532|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 532, False: 0]
  ------------------
   89|    532|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    532|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    532|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    532|                                                  mesh_data));
   93|    532|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.84k|    }

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

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     72|    const PointIndex*) {
   50|     72|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     72|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     72|  this->transform().ComputeOriginalValue(zero_vals.get(), in_corr, out_data);
   54|       |
   55|       |  // Decode data from the front using D(i) = D(i) + D(i - 1).
   56|  18.5M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 18.5M, False: 72]
  ------------------
   57|  18.5M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  18.5M|                                           in_corr + i, out_data + i);
   59|  18.5M|  }
   60|     72|  return true;
   61|     72|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    137|    const PointIndex*) {
   50|    137|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    137|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    137|  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|   307k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 307k, False: 137]
  ------------------
   57|   307k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   307k|                                           in_corr + i, out_data + i);
   59|   307k|  }
   60|    137|  return true;
   61|    137|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    338|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    281|    const PointIndex*) {
   50|    281|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    281|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    281|  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.2M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 36.2M, False: 281]
  ------------------
   57|  36.2M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  36.2M|                                           in_corr + i, out_data + i);
   59|  36.2M|  }
   60|    281|  return true;
   61|    281|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     91|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    169|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    389|    uint16_t bitstream_version) {
   38|    389|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|    389|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 389, False: 0]
  ------------------
   40|    389|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 3, False: 386]
  ------------------
   41|    386|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 7, False: 379]
  ------------------
   42|    379|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 4, False: 375]
  ------------------
   43|    375|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 8, False: 367]
  ------------------
   44|    367|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 358, False: 9]
  ------------------
   45|    381|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 8]
  ------------------
   46|    381|    const CornerTable* const ct = source->GetCornerTable();
   47|    381|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|    381|        source->GetAttributeEncodingData(att_id);
   49|    381|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 36, False: 345]
  |  Branch (49:26): [True: 0, False: 345]
  ------------------
   50|       |      // No connectivity data found.
   51|     36|      return nullptr;
   52|     36|    }
   53|       |    // Connectivity data exists.
   54|    345|    const MeshAttributeCornerTable* const att_ct =
   55|    345|        source->GetAttributeCornerTable(att_id);
   56|    345|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 168, False: 177]
  ------------------
   57|    168|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    168|      MeshData md;
   59|    168|      md.Set(source->mesh(), att_ct,
   60|    168|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    168|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    168|      MeshPredictionSchemeFactoryT factory;
   63|    168|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    168|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 158, False: 10]
  ------------------
   65|    158|        return ret;
   66|    158|      }
   67|    177|    } else {
   68|    177|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    177|      MeshData md;
   70|    177|      md.Set(source->mesh(), ct,
   71|    177|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    177|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    177|      MeshPredictionSchemeFactoryT factory;
   74|    177|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    177|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 168, False: 9]
  ------------------
   76|    168|        return ret;
   77|    168|      }
   78|    177|    }
   79|    345|  }
   80|     27|  return nullptr;
   81|    389|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    476|    uint16_t bitstream_version) {
   38|    476|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|    476|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 476, False: 0]
  ------------------
   40|    476|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 18, False: 458]
  ------------------
   41|    458|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 5, False: 453]
  ------------------
   42|    453|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 10, False: 443]
  ------------------
   43|    443|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 5, False: 438]
  ------------------
   44|    438|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 413, False: 25]
  ------------------
   45|    459|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 8, False: 17]
  ------------------
   46|    459|    const CornerTable* const ct = source->GetCornerTable();
   47|    459|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|    459|        source->GetAttributeEncodingData(att_id);
   49|    459|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 119, False: 340]
  |  Branch (49:26): [True: 0, False: 340]
  ------------------
   50|       |      // No connectivity data found.
   51|    119|      return nullptr;
   52|    119|    }
   53|       |    // Connectivity data exists.
   54|    340|    const MeshAttributeCornerTable* const att_ct =
   55|    340|        source->GetAttributeCornerTable(att_id);
   56|    340|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 172, False: 168]
  ------------------
   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: 151, False: 21]
  ------------------
   65|    151|        return ret;
   66|    151|      }
   67|    172|    } else {
   68|    168|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    168|      MeshData md;
   70|    168|      md.Set(source->mesh(), ct,
   71|    168|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    168|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    168|      MeshPredictionSchemeFactoryT factory;
   74|    168|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    168|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 156, False: 12]
  ------------------
   76|    156|        return ret;
   77|    156|      }
   78|    168|    }
   79|    340|  }
   80|     50|  return nullptr;
   81|    476|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  5.48k|    uint16_t bitstream_version) {
   38|  5.48k|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|  5.48k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 5.48k, False: 0]
  ------------------
   40|  5.48k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.41k, False: 4.07k]
  ------------------
   41|  4.07k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 820, False: 3.25k]
  ------------------
   42|  3.25k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1.10k, False: 2.14k]
  ------------------
   43|  2.14k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 524, False: 1.62k]
  ------------------
   44|  1.62k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 942, False: 681]
  ------------------
   45|  5.24k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 439, False: 242]
  ------------------
   46|  5.24k|    const CornerTable* const ct = source->GetCornerTable();
   47|  5.24k|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|  5.24k|        source->GetAttributeEncodingData(att_id);
   49|  5.24k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 84, False: 5.16k]
  |  Branch (49:26): [True: 0, False: 5.16k]
  ------------------
   50|       |      // No connectivity data found.
   51|     84|      return nullptr;
   52|     84|    }
   53|       |    // Connectivity data exists.
   54|  5.16k|    const MeshAttributeCornerTable* const att_ct =
   55|  5.16k|        source->GetAttributeCornerTable(att_id);
   56|  5.16k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 2.32k, False: 2.84k]
  ------------------
   57|  2.32k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  2.32k|      MeshData md;
   59|  2.32k|      md.Set(source->mesh(), att_ct,
   60|  2.32k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  2.32k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  2.32k|      MeshPredictionSchemeFactoryT factory;
   63|  2.32k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  2.32k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 2.32k, False: 0]
  ------------------
   65|  2.32k|        return ret;
   66|  2.32k|      }
   67|  2.84k|    } else {
   68|  2.84k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.84k|      MeshData md;
   70|  2.84k|      md.Set(source->mesh(), ct,
   71|  2.84k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.84k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.84k|      MeshPredictionSchemeFactoryT factory;
   74|  2.84k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.84k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.84k, False: 0]
  ------------------
   76|  2.84k|        return ret;
   77|  2.84k|      }
   78|  2.84k|    }
   79|  5.16k|  }
   80|    242|  return nullptr;
   81|  5.48k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.00M|  bool IsInBottomLeft(const Point2& p) const {
   93|  1.00M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 716k, False: 287k]
  |  Branch (93:22): [True: 646k, False: 70.3k]
  ------------------
   94|   646k|      return true;
   95|   646k|    }
   96|   358k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 136k, False: 222k]
  |  Branch (96:25): [True: 27.4k, False: 108k]
  ------------------
   97|  1.00M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.00M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.00M|    const DataType sign_x = pred[0];
   52|  1.00M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.00M|    int32_t rotation_count = 0;
   55|  1.00M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 716k, False: 287k]
  ------------------
   56|   716k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 646k, False: 70.3k]
  ------------------
   57|   646k|        rotation_count = 0;
   58|   646k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 23.5k, False: 46.8k]
  ------------------
   59|  23.5k|        rotation_count = 3;
   60|  46.8k|      } else {
   61|  46.8k|        rotation_count = 1;
   62|  46.8k|      }
   63|   716k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 151k, False: 136k]
  ------------------
   64|   151k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 79.2k, False: 72.5k]
  ------------------
   65|  79.2k|        rotation_count = 2;
   66|  79.2k|      } else {
   67|  72.5k|        rotation_count = 1;
   68|  72.5k|      }
   69|   151k|    } else {
   70|   136k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 27.4k, False: 108k]
  ------------------
   71|  27.4k|        rotation_count = 0;
   72|   108k|      } else {
   73|   108k|        rotation_count = 3;
   74|   108k|      }
   75|   136k|    }
   76|  1.00M|    return rotation_count;
   77|  1.00M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   661k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   661k|    switch (rotation_count) {
   81|   251k|      case 1:
  ------------------
  |  Branch (81:7): [True: 251k, False: 410k]
  ------------------
   82|   251k|        return Point2(p[1], -p[0]);
   83|   158k|      case 2:
  ------------------
  |  Branch (83:7): [True: 158k, False: 503k]
  ------------------
   84|   158k|        return Point2(-p[0], -p[1]);
   85|   251k|      case 3:
  ------------------
  |  Branch (85:7): [True: 251k, False: 410k]
  ------------------
   86|   251k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 661k]
  ------------------
   88|      0|        return p;
   89|   661k|    }
   90|   661k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    476|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

_ZN5draco37PredictionSchemeWrapDecodingTransformIiiE19DecodeTransformDataEPNS_13DecoderBufferE:
   65|  4.88k|  bool DecodeTransformData(DecoderBuffer* buffer) {
   66|  4.88k|    DataTypeT min_value, max_value;
   67|  4.88k|    if (!buffer->Decode(&min_value)) {
  ------------------
  |  Branch (67:9): [True: 47, False: 4.83k]
  ------------------
   68|     47|      return false;
   69|     47|    }
   70|  4.83k|    if (!buffer->Decode(&max_value)) {
  ------------------
  |  Branch (70:9): [True: 52, False: 4.78k]
  ------------------
   71|     52|      return false;
   72|     52|    }
   73|  4.78k|    if (min_value > max_value) {
  ------------------
  |  Branch (73:9): [True: 173, False: 4.60k]
  ------------------
   74|    173|      return false;
   75|    173|    }
   76|  4.60k|    this->set_min_value(min_value);
   77|  4.60k|    this->set_max_value(max_value);
   78|  4.60k|    if (!this->InitCorrectionBounds()) {
  ------------------
  |  Branch (78:9): [True: 26, False: 4.58k]
  ------------------
   79|     26|      return false;
   80|     26|    }
   81|  4.58k|    return true;
   82|  4.60k|  }
_ZNK5draco37PredictionSchemeWrapDecodingTransformIiiE20ComputeOriginalValueEPKiS3_Pi:
   38|  47.0M|                                   DataTypeT* out_original_vals) const {
   39|       |    // For now we assume both |DataTypeT| and |CorrTypeT| are equal.
   40|  47.0M|    static_assert(std::is_same<DataTypeT, CorrTypeT>::value,
   41|  47.0M|                  "Predictions and corrections must have the same type.");
   42|       |
   43|       |    // The only valid implementation right now is for int32_t.
   44|  47.0M|    static_assert(std::is_same<DataTypeT, int32_t>::value,
   45|  47.0M|                  "Only int32_t is supported for predicted values.");
   46|       |
   47|  47.0M|    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|   509M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (53:21): [True: 461M, False: 47.0M]
  ------------------
   54|   461M|      int64_t value = static_cast<int64_t>(predicted_vals[i]) +
   55|   461M|                      static_cast<int64_t>(corr_vals[i]);
   56|   461M|      if (value > this->max_value()) {
  ------------------
  |  Branch (56:11): [True: 165k, False: 461M]
  ------------------
   57|   165k|        value -= this->max_dif();
   58|   461M|      } else if (value < this->min_value()) {
  ------------------
  |  Branch (58:18): [True: 1.85M, False: 459M]
  ------------------
   59|  1.85M|        value += this->max_dif();
   60|  1.85M|      }
   61|   461M|      out_original_vals[i] = static_cast<DataTypeT>(value);
   62|   461M|    }
   63|  47.0M|  }
_ZN5draco37PredictionSchemeWrapDecodingTransformIiiEC2Ev:
   32|  5.50k|  PredictionSchemeWrapDecodingTransform() {}

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

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  8.95k|  const PointAttribute* attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  39.5M|  PointAttribute* attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  6.39k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  29.0k|  PointCloudDecoder* decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  9.92k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  9.92k|    portable_attribute_ = std::move(att);
   71|  9.92k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  32.4k|  PointAttribute* portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  20.3k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  12.2k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  5.14k|    DecoderBuffer* buffer) {
   30|  5.14k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 96, False: 5.04k]
  ------------------
   31|     96|    return false;
   32|     96|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  5.04k|  const int32_t num_attributes = GetNumAttributes();
   35|  5.04k|  sequential_decoders_.resize(num_attributes);
   36|  25.3k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 20.3k, False: 5.03k]
  ------------------
   37|  20.3k|    uint8_t decoder_type;
   38|  20.3k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 3, False: 20.3k]
  ------------------
   39|      3|      return false;
   40|      3|    }
   41|       |    // Create the decoder from the id.
   42|  20.3k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  20.3k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 7, False: 20.3k]
  ------------------
   44|      7|      return false;
   45|      7|    }
   46|  20.3k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 4, False: 20.3k]
  ------------------
   47|      4|      return false;
   48|      4|    }
   49|  20.3k|  }
   50|  5.03k|  return true;
   51|  5.04k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  4.70k|    DecoderBuffer* buffer) {
   55|  4.70k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 4.70k]
  |  Branch (55:22): [True: 1, False: 4.70k]
  ------------------
   56|      1|    return false;
   57|      1|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  4.70k|  const int32_t num_attributes = GetNumAttributes();
   60|  24.3k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 19.6k, False: 4.70k]
  ------------------
   61|  19.6k|    PointAttribute* const pa =
   62|  19.6k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  19.6k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 1, False: 19.6k]
  ------------------
   64|      1|      return false;
   65|      1|    }
   66|  19.6k|  }
   67|  4.70k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  4.70k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  4.70k|    DecoderBuffer* in_buffer) {
   72|  4.70k|  const int32_t num_attributes = GetNumAttributes();
   73|  14.3k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 11.9k, False: 2.42k]
  ------------------
   74|  11.9k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.28k, False: 9.63k]
  ------------------
   75|  11.9k|                                                          in_buffer)) {
   76|  2.28k|      return false;
   77|  2.28k|    }
   78|  11.9k|  }
   79|  2.42k|  return true;
   80|  4.70k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  2.42k|    DecodeDataNeededByPortableTransforms(DecoderBuffer* in_buffer) {
   84|  2.42k|  const int32_t num_attributes = GetNumAttributes();
   85|  7.12k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 5.14k, False: 1.97k]
  ------------------
   86|  5.14k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 448, False: 4.69k]
  ------------------
   87|  5.14k|            point_ids_, in_buffer)) {
   88|    448|      return false;
   89|    448|    }
   90|  5.14k|  }
   91|  1.97k|  return true;
   92|  2.42k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.97k|    TransformAttributesToOriginalFormat() {
   96|  1.97k|  const int32_t num_attributes = GetNumAttributes();
   97|  5.83k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 4.24k, False: 1.58k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  4.24k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 4.24k, False: 0]
  ------------------
  100|  4.24k|      const PointAttribute* const attribute =
  101|  4.24k|          sequential_decoders_[i]->attribute();
  102|  4.24k|      const PointAttribute* const portable_attribute =
  103|  4.24k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  4.24k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 3.32k, False: 922]
  |  Branch (104:11): [True: 1.18k, False: 3.06k]
  ------------------
  105|  3.32k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 1.18k, False: 2.14k]
  ------------------
  106|  3.32k|              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.18k|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|  1.18k|        continue;
  114|  1.18k|      }
  115|  4.24k|    }
  116|  3.06k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 389, False: 2.67k]
  ------------------
  117|  3.06k|            point_ids_)) {
  118|    389|      return false;
  119|    389|    }
  120|  3.06k|  }
  121|  1.58k|  return true;
  122|  1.97k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  20.3k|    uint8_t decoder_type) {
  127|  20.3k|  switch (decoder_type) {
  128|  3.27k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 3.27k, False: 17.0k]
  ------------------
  129|  3.27k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  3.27k|          new SequentialAttributeDecoder());
  131|  15.8k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 15.8k, False: 4.52k]
  ------------------
  132|  15.8k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  15.8k|          new SequentialIntegerAttributeDecoder());
  134|    168|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 168, False: 20.1k]
  ------------------
  135|    168|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    168|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.07k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.07k, False: 19.2k]
  ------------------
  139|  1.07k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.07k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|      7|    default:
  ------------------
  |  Branch (142:5): [True: 7, False: 20.3k]
  ------------------
  143|      7|      break;
  144|  20.3k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|      7|  return nullptr;
  147|  20.3k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  17.0k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() =
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   27|  17.0k|                                             int attribute_id) {
   28|  17.0k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (28:7): [True: 0, False: 17.0k]
  ------------------
   29|      0|    return false;
   30|      0|  }
   31|  17.0k|  return true;
   32|  17.0k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   35|  2.14k|    const std::vector<PointIndex>& point_ids) {
   36|  2.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   37|  2.14k|  if (decoder() &&
  ------------------
  |  Branch (37:7): [True: 2.14k, False: 0]
  ------------------
   38|  2.14k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (38:7): [True: 0, False: 2.14k]
  ------------------
   39|      0|    return true;  // Don't revert the transform here for older files.
   40|      0|  }
   41|  2.14k|#endif
   42|  2.14k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   43|  2.14k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   46|  10.3k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   47|       |  // Decode prediction scheme.
   48|  10.3k|  int8_t prediction_scheme_method;
   49|  10.3k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (49:7): [True: 29, False: 10.3k]
  ------------------
   50|     29|    return false;
   51|     29|  }
   52|       |  // Check that decoded prediction scheme method type is valid.
   53|  10.3k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (53:7): [True: 61, False: 10.2k]
  ------------------
   54|  10.2k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (54:7): [True: 157, False: 10.0k]
  ------------------
   55|    218|    return false;
   56|    218|  }
   57|  10.0k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (57:7): [True: 10.0k, False: 10]
  ------------------
   58|  10.0k|    int8_t prediction_transform_type;
   59|  10.0k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (59:9): [True: 15, False: 10.0k]
  ------------------
   60|     15|      return false;
   61|     15|    }
   62|       |    // Check that decoded prediction scheme transform type is valid.
   63|  10.0k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (63:9): [True: 28, False: 10.0k]
  ------------------
   64|  10.0k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (64:9): [True: 95, False: 9.93k]
  ------------------
   65|    123|      return false;
   66|    123|    }
   67|  9.93k|    prediction_scheme_ = CreateIntPredictionScheme(
   68|  9.93k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   69|  9.93k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   70|  9.93k|  }
   71|       |
   72|  9.94k|  if (prediction_scheme_) {
  ------------------
  |  Branch (72:7): [True: 6.39k, False: 3.55k]
  ------------------
   73|  6.39k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (73:9): [True: 25, False: 6.36k]
  ------------------
   74|     25|      return false;
   75|     25|    }
   76|  6.39k|  }
   77|       |
   78|  9.92k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (78:7): [True: 1.82k, False: 8.10k]
  ------------------
   79|  1.82k|    return false;
   80|  1.82k|  }
   81|       |
   82|  8.10k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   83|  8.10k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   84|  8.10k|  if (decoder() &&
  ------------------
  |  Branch (84:7): [True: 8.10k, False: 0]
  ------------------
   85|  8.10k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  8.10k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (85:7): [True: 0, False: 8.10k]
  ------------------
   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|  8.10k|#endif
   92|  8.10k|  return true;
   93|  8.10k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   98|  8.96k|    PredictionSchemeTransformType transform_type) {
   99|  8.96k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (99:7): [True: 3.46k, False: 5.50k]
  ------------------
  100|  3.46k|    return nullptr;  // For now we support only wrap transform.
  101|  3.46k|  }
  102|  5.50k|  return CreatePredictionSchemeForDecoder<
  103|  5.50k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  104|  5.50k|      method, attribute_id(), decoder());
  105|  8.96k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  108|  9.92k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
  109|  9.92k|  const int num_components = GetNumValueComponents();
  110|  9.92k|  if (num_components <= 0) {
  ------------------
  |  Branch (110:7): [True: 0, False: 9.92k]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|  9.92k|  const size_t num_entries = point_ids.size();
  114|  9.92k|  const size_t num_values = num_entries * num_components;
  115|  9.92k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  116|  9.92k|  int32_t* const portable_attribute_data = GetPortableAttributeData();
  117|  9.92k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (117:7): [True: 7, False: 9.91k]
  ------------------
  118|      7|    return false;
  119|      7|  }
  120|  9.91k|  uint8_t compressed;
  121|  9.91k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (121:7): [True: 20, False: 9.89k]
  ------------------
  122|     20|    return false;
  123|     20|  }
  124|  9.89k|  if (compressed > 0) {
  ------------------
  |  Branch (124:7): [True: 900, False: 8.99k]
  ------------------
  125|       |    // Decode compressed values.
  126|    900|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (126:9): [True: 281, False: 619]
  ------------------
  127|    900|                       in_buffer,
  128|    900|                       reinterpret_cast<uint32_t*>(portable_attribute_data))) {
  129|    281|      return false;
  130|    281|    }
  131|  8.99k|  } else {
  132|       |    // Decode the integer data directly.
  133|       |    // Get the number of bytes for a given entry.
  134|  8.99k|    uint8_t num_bytes;
  135|  8.99k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (135:9): [True: 14, False: 8.98k]
  ------------------
  136|     14|      return false;
  137|     14|    }
  138|  8.98k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (138:9): [True: 472, False: 8.51k]
  ------------------
  139|    472|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (139:11): [True: 0, False: 472]
  ------------------
  140|    472|          sizeof(int32_t) * num_values) {
  141|      0|        return false;
  142|      0|      }
  143|    472|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (143:11): [True: 14, False: 458]
  ------------------
  144|    472|                             sizeof(int32_t) * num_values)) {
  145|     14|        return false;
  146|     14|      }
  147|  8.51k|    } else {
  148|  8.51k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (148:11): [True: 22, False: 8.48k]
  ------------------
  149|  8.51k|          num_bytes * num_values) {
  150|     22|        return false;
  151|     22|      }
  152|  8.48k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (152:11): [True: 24, False: 8.46k]
  ------------------
  153|  8.48k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  154|     24|        return false;
  155|     24|      }
  156|   996M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (156:26): [True: 996M, False: 8.46k]
  ------------------
  157|   996M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (157:13): [True: 0, False: 996M]
  ------------------
  158|      0|          return false;
  159|      0|        }
  160|   996M|      }
  161|  8.46k|    }
  162|  8.98k|  }
  163|       |
  164|  9.54k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (164:7): [True: 9.54k, False: 0]
  |  Branch (164:26): [True: 3.39k, False: 6.15k]
  ------------------
  165|  8.68k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (165:26): [True: 5.29k, False: 861]
  ------------------
  166|       |    // Convert the values back to the original signed format.
  167|  8.68k|    ConvertSymbolsToSignedInts(
  168|  8.68k|        reinterpret_cast<const uint32_t*>(portable_attribute_data),
  169|  8.68k|        static_cast<int>(num_values), portable_attribute_data);
  170|  8.68k|  }
  171|       |
  172|       |  // If the data was encoded with a prediction scheme, we must revert it.
  173|  9.54k|  if (prediction_scheme_) {
  ------------------
  |  Branch (173:7): [True: 6.15k, False: 3.39k]
  ------------------
  174|  6.15k|    prediction_scheme_->SetMaxNumPredictedValues(num_values);
  175|  6.15k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (175:9): [True: 852, False: 5.30k]
  ------------------
  176|    852|      return false;
  177|    852|    }
  178|       |
  179|  5.30k|    if (num_values > 0) {
  ------------------
  |  Branch (179:9): [True: 5.30k, False: 0]
  ------------------
  180|  5.30k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (180:11): [True: 586, False: 4.71k]
  ------------------
  181|  5.30k|              portable_attribute_data, portable_attribute_data,
  182|  5.30k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  183|    586|        return false;
  184|    586|      }
  185|  5.30k|    }
  186|  5.30k|  }
  187|  8.10k|  return true;
  188|  9.54k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  190|  1.71k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  191|  1.71k|  switch (attribute()->data_type()) {
  192|    173|    case DT_UINT8:
  ------------------
  |  Branch (192:5): [True: 173, False: 1.53k]
  ------------------
  193|    173|      StoreTypedValues<uint8_t>(num_values);
  194|    173|      break;
  195|    826|    case DT_INT8:
  ------------------
  |  Branch (195:5): [True: 826, False: 886]
  ------------------
  196|    826|      StoreTypedValues<int8_t>(num_values);
  197|    826|      break;
  198|     79|    case DT_UINT16:
  ------------------
  |  Branch (198:5): [True: 79, False: 1.63k]
  ------------------
  199|     79|      StoreTypedValues<uint16_t>(num_values);
  200|     79|      break;
  201|    207|    case DT_INT16:
  ------------------
  |  Branch (201:5): [True: 207, False: 1.50k]
  ------------------
  202|    207|      StoreTypedValues<int16_t>(num_values);
  203|    207|      break;
  204|    208|    case DT_UINT32:
  ------------------
  |  Branch (204:5): [True: 208, False: 1.50k]
  ------------------
  205|    208|      StoreTypedValues<uint32_t>(num_values);
  206|    208|      break;
  207|    112|    case DT_INT32:
  ------------------
  |  Branch (207:5): [True: 112, False: 1.60k]
  ------------------
  208|    112|      StoreTypedValues<int32_t>(num_values);
  209|    112|      break;
  210|    107|    default:
  ------------------
  |  Branch (210:5): [True: 107, False: 1.60k]
  ------------------
  211|    107|      return false;
  212|  1.71k|  }
  213|  1.60k|  return true;
  214|  1.71k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  238|  9.92k|    int num_entries, int num_components) {
  239|  9.92k|  GeometryAttribute ga;
  240|  9.92k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  241|  9.92k|          false, num_components * DataTypeLength(DT_INT32), 0);
  242|  9.92k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  243|  9.92k|  port_att->SetIdentityMapping();
  244|  9.92k|  port_att->Reset(num_entries);
  245|  9.92k|  port_att->set_unique_id(attribute()->unique_id());
  246|  9.92k|  SetPortableAttribute(std::move(port_att));
  247|  9.92k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  217|    173|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    173|  const int num_components = attribute()->num_components();
  219|    173|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    173|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    173|      new AttributeTypeT[num_components]);
  222|    173|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    173|  int val_id = 0;
  224|    173|  int out_byte_pos = 0;
  225|  1.04M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 1.04M, False: 173]
  ------------------
  226|  22.1M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 21.1M, False: 1.04M]
  ------------------
  227|  21.1M|      const AttributeTypeT value =
  228|  21.1M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  21.1M|      att_val[c] = value;
  230|  21.1M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  1.04M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  1.04M|    out_byte_pos += entry_size;
  234|  1.04M|  }
  235|    173|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  217|    826|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    826|  const int num_components = attribute()->num_components();
  219|    826|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    826|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    826|      new AttributeTypeT[num_components]);
  222|    826|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    826|  int val_id = 0;
  224|    826|  int out_byte_pos = 0;
  225|  35.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 35.4M, False: 826]
  ------------------
  226|   187M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 151M, False: 35.4M]
  ------------------
  227|   151M|      const AttributeTypeT value =
  228|   151M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   151M|      att_val[c] = value;
  230|   151M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  35.4M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  35.4M|    out_byte_pos += entry_size;
  234|  35.4M|  }
  235|    826|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  217|     79|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|     79|  const int num_components = attribute()->num_components();
  219|     79|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|     79|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|     79|      new AttributeTypeT[num_components]);
  222|     79|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|     79|  int val_id = 0;
  224|     79|  int out_byte_pos = 0;
  225|   593k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 592k, False: 79]
  ------------------
  226|  35.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 35.2M, False: 592k]
  ------------------
  227|  35.2M|      const AttributeTypeT value =
  228|  35.2M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  35.2M|      att_val[c] = value;
  230|  35.2M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   592k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   592k|    out_byte_pos += entry_size;
  234|   592k|  }
  235|     79|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  217|    207|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    207|  const int num_components = attribute()->num_components();
  219|    207|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    207|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    207|      new AttributeTypeT[num_components]);
  222|    207|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    207|  int val_id = 0;
  224|    207|  int out_byte_pos = 0;
  225|   810k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 810k, False: 207]
  ------------------
  226|  28.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 27.6M, False: 810k]
  ------------------
  227|  27.6M|      const AttributeTypeT value =
  228|  27.6M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  27.6M|      att_val[c] = value;
  230|  27.6M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   810k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   810k|    out_byte_pos += entry_size;
  234|   810k|  }
  235|    207|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  217|    208|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    208|  const int num_components = attribute()->num_components();
  219|    208|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    208|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    208|      new AttributeTypeT[num_components]);
  222|    208|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    208|  int val_id = 0;
  224|    208|  int out_byte_pos = 0;
  225|  1.41M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 1.41M, False: 208]
  ------------------
  226|   106M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 105M, False: 1.41M]
  ------------------
  227|   105M|      const AttributeTypeT value =
  228|   105M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   105M|      att_val[c] = value;
  230|   105M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  1.41M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  1.41M|    out_byte_pos += entry_size;
  234|  1.41M|  }
  235|    208|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  217|    112|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    112|  const int num_components = attribute()->num_components();
  219|    112|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    112|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    112|      new AttributeTypeT[num_components]);
  222|    112|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    112|  int val_id = 0;
  224|    112|  int out_byte_pos = 0;
  225|   138k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 138k, False: 112]
  ------------------
  226|  23.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 23.5M, False: 138k]
  ------------------
  227|  23.5M|      const AttributeTypeT value =
  228|  23.5M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|  23.5M|      att_val[c] = value;
  230|  23.5M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   138k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   138k|    out_byte_pos += entry_size;
  234|   138k|  }
  235|    112|}

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

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

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

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

_ZN5draco16DirectBitDecoderC2Ev:
   19|  6.41k|DirectBitDecoder::DirectBitDecoder() : pos_(bits_.end()), num_used_bits_(0) {}
_ZN5draco16DirectBitDecoderD2Ev:
   21|  6.41k|DirectBitDecoder::~DirectBitDecoder() { Clear(); }
_ZN5draco16DirectBitDecoder13StartDecodingEPNS_13DecoderBufferE:
   23|  3.12k|bool DirectBitDecoder::StartDecoding(DecoderBuffer* source_buffer) {
   24|  3.12k|  Clear();
   25|  3.12k|  uint32_t size_in_bytes;
   26|  3.12k|  if (!source_buffer->Decode(&size_in_bytes)) {
  ------------------
  |  Branch (26:7): [True: 45, False: 3.08k]
  ------------------
   27|     45|    return false;
   28|     45|  }
   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.08k|  if (size_in_bytes == 0 || size_in_bytes & 0x3) {
  ------------------
  |  Branch (32:7): [True: 14, False: 3.06k]
  |  Branch (32:29): [True: 66, False: 3.00k]
  ------------------
   33|     80|    return false;
   34|     80|  }
   35|  3.00k|  if (size_in_bytes > source_buffer->remaining_size()) {
  ------------------
  |  Branch (35:7): [True: 72, False: 2.93k]
  ------------------
   36|     72|    return false;
   37|     72|  }
   38|  2.93k|  const uint32_t num_32bit_elements = size_in_bytes / 4;
   39|  2.93k|  bits_.resize(num_32bit_elements);
   40|  2.93k|  if (!source_buffer->Decode(bits_.data(), size_in_bytes)) {
  ------------------
  |  Branch (40:7): [True: 0, False: 2.93k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  2.93k|  pos_ = bits_.begin();
   44|  2.93k|  num_used_bits_ = 0;
   45|  2.93k|  return true;
   46|  2.93k|}
_ZN5draco16DirectBitDecoder5ClearEv:
   48|  9.53k|void DirectBitDecoder::Clear() {
   49|  9.53k|  bits_.clear();
   50|  9.53k|  num_used_bits_ = 0;
   51|  9.53k|  pos_ = bits_.end();
   52|  9.53k|}

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  8.37M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t* value) {
   51|  8.37M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  8.37M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  8.37M|    const int remaining = 32 - num_used_bits_;
   54|  8.37M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 7.15M, False: 1.22M]
  ------------------
   55|  7.15M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 6.78M, False: 369k]
  ------------------
   56|  6.78M|        return false;
   57|  6.78M|      }
   58|   369k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   369k|      num_used_bits_ += nbits;
   60|   369k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 12.2k, False: 357k]
  ------------------
   61|  12.2k|        ++pos_;
   62|  12.2k|        num_used_bits_ = 0;
   63|  12.2k|      }
   64|  1.22M|    } else {
   65|  1.22M|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 1.21M, False: 12.6k]
  ------------------
   66|  1.21M|        return false;
   67|  1.21M|      }
   68|  12.6k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  12.6k|      num_used_bits_ = nbits - remaining;
   70|  12.6k|      ++pos_;
   71|  12.6k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  12.6k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  12.6k|    }
   74|   382k|    return true;
   75|  8.37M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  7.79M|  bool DecodeNextBit() {
   35|  7.79M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  7.79M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 7.38M, False: 410k]
  ------------------
   37|  7.38M|      return false;
   38|  7.38M|    }
   39|   410k|    const bool bit = *pos_ & selector;
   40|   410k|    ++num_used_bits_;
   41|   410k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 12.6k, False: 398k]
  ------------------
   42|  12.6k|      ++pos_;
   43|  12.6k|      num_used_bits_ = 0;
   44|  12.6k|    }
   45|   410k|    return bit;
   46|  7.79M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    741|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    719|  FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    719|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    491|  bool StartDecoding(DecoderBuffer* source_buffer) {
   34|  11.6k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 11.3k, False: 322]
  ------------------
   35|  11.3k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 169, False: 11.1k]
  ------------------
   36|    169|        return false;
   37|    169|      }
   38|  11.3k|    }
   39|    322|    return bit_decoder_.StartDecoding(source_buffer);
   40|    491|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.47M|  void DecodeLeastSignificantBits32(int nbits, uint32_t* value) {
   48|  2.47M|    uint32_t result = 0;
   49|  15.4M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 12.9M, False: 2.47M]
  ------------------
   50|  12.9M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  12.9M|      result = (result << 1) + bit;
   52|  12.9M|    }
   53|  2.47M|    *value = result;
   54|  2.47M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|    138|  void EndDecoding() {
   57|  4.55k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 4.41k, False: 138]
  ------------------
   58|  4.41k|      folded_number_decoders_[i].EndDecoding();
   59|  4.41k|    }
   60|    138|    bit_decoder_.EndDecoding();
   61|    138|  }

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  55.4k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  33.0k|                                const uint8_t* const buf, int offset) {
  301|  33.0k|  unsigned x;
  302|  33.0k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 61, False: 32.9k]
  ------------------
  303|     61|    return 1;
  304|     61|  }
  305|  32.9k|  ans->buf = buf;
  306|  32.9k|  x = buf[offset - 1] >> 6;
  307|  32.9k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 28.7k, False: 4.25k]
  ------------------
  308|  28.7k|    ans->buf_offset = offset - 1;
  309|  28.7k|    ans->state = buf[offset - 1] & 0x3F;
  310|  28.7k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 3.88k, False: 366]
  ------------------
  311|  3.88k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 11, False: 3.87k]
  ------------------
  312|     11|      return 1;
  313|     11|    }
  314|  3.87k|    ans->buf_offset = offset - 2;
  315|  3.87k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  3.87k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 342, False: 24]
  ------------------
  317|    342|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 2, False: 340]
  ------------------
  318|      2|      return 1;
  319|      2|    }
  320|    340|    ans->buf_offset = offset - 3;
  321|    340|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    340|  } else {
  323|     24|    return 1;
  324|     24|  }
  325|  32.9k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  32.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  32.9k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  32.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  32.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 17, False: 32.9k]
  ------------------
  327|     17|    return 1;
  328|     17|  }
  329|  32.9k|  return 0;
  330|  32.9k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  3.87k|static uint32_t mem_get_le16(const void* vmem) {
   68|  3.87k|  uint32_t val;
   69|  3.87k|  const uint8_t* mem = (const uint8_t*)vmem;
   70|       |
   71|  3.87k|  val = mem[1] << 8;
   72|  3.87k|  val |= mem[0];
   73|  3.87k|  return val;
   74|  3.87k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    340|static uint32_t mem_get_le24(const void* vmem) {
   77|    340|  uint32_t val;
   78|    340|  const uint8_t* mem = (const uint8_t*)vmem;
   79|       |
   80|    340|  val = mem[2] << 16;
   81|    340|  val |= mem[1] << 8;
   82|    340|  val |= mem[0];
   83|    340|  return val;
   84|    340|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|   127M|static inline int rabs_desc_read(struct AnsDecoder* ans, AnsP8 p0) {
  167|   127M|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|   127M|  unsigned quot, rem, x, xn;
  172|   127M|#endif
  173|   127M|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|   127M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|   127M|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|   254M|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 102M, False: 24.6M]
  |  Branch (174:40): [True: 114k, False: 102M]
  ------------------
  175|   114k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   114k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   114k|  }
  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|   127M|  x = ans->state;
  184|   127M|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   127M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|   127M|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   127M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|   127M|  xn = quot * p;
  187|   127M|  val = rem < p;
  188|   127M|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|   254M|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 109M, False: 17.5M]
  |  |  ------------------
  ------------------
  189|   109M|    ans->state = xn + rem;
  190|   109M|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  17.5M|    ans->state = x - xn - p;
  193|  17.5M|  }
  194|   127M|#endif
  195|   127M|  return val;
  196|   127M|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  81.8k|static inline int ans_read_end(struct AnsDecoder* const ans) {
  333|  81.8k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  81.8k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  81.8k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  3.97k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  484|  2.38k|                                       uint32_t num_symbols) {
  485|  2.38k|    lut_table_.resize(rans_precision);
  486|  2.38k|    probability_table_.resize(num_symbols);
  487|  2.38k|    uint32_t cum_prob = 0;
  488|  2.38k|    uint32_t act_prob = 0;
  489|  18.9k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 16.7k, False: 2.16k]
  ------------------
  490|  16.7k|      probability_table_[i].prob = token_probs[i];
  491|  16.7k|      probability_table_[i].cum_prob = cum_prob;
  492|  16.7k|      cum_prob += token_probs[i];
  493|  16.7k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 225, False: 16.5k]
  ------------------
  494|    225|        return false;
  495|    225|      }
  496|  7.89M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 7.88M, False: 16.5k]
  ------------------
  497|  7.88M|        lut_table_[j] = i;
  498|  7.88M|      }
  499|  16.5k|      act_prob = cum_prob;
  500|  16.5k|    }
  501|  2.16k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 274, False: 1.88k]
  ------------------
  502|    274|      return false;
  503|    274|    }
  504|  1.88k|    return true;
  505|  2.16k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.86k|  inline int read_init(const uint8_t* const buf, int offset) {
  422|  1.86k|    unsigned x;
  423|  1.86k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 114, False: 1.75k]
  ------------------
  424|    114|      return 1;
  425|    114|    }
  426|  1.75k|    ans_.buf = buf;
  427|  1.75k|    x = buf[offset - 1] >> 6;
  428|  1.75k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1.14k, False: 607]
  ------------------
  429|  1.14k|      ans_.buf_offset = offset - 1;
  430|  1.14k|      ans_.state = buf[offset - 1] & 0x3F;
  431|  1.14k|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 261, False: 346]
  ------------------
  432|    261|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 22, False: 239]
  ------------------
  433|     22|        return 1;
  434|     22|      }
  435|    239|      ans_.buf_offset = offset - 2;
  436|    239|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    346|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 227, False: 119]
  ------------------
  438|    227|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 45, False: 182]
  ------------------
  439|     45|        return 1;
  440|     45|      }
  441|    182|      ans_.buf_offset = offset - 3;
  442|    182|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    182|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 119, False: 0]
  ------------------
  444|    119|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 16, False: 103]
  ------------------
  445|     16|        return 1;
  446|     16|      }
  447|    103|      ans_.buf_offset = offset - 4;
  448|    103|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|    103|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|  1.66k|    ans_.state += l_rans_base;
  453|  1.66k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.66k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 98, False: 1.57k]
  ------------------
  454|     98|      return 1;
  455|     98|    }
  456|  1.57k|    return 0;
  457|  1.66k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    354|static uint32_t mem_get_le16(const void* vmem) {
   68|    354|  uint32_t val;
   69|    354|  const uint8_t* mem = (const uint8_t*)vmem;
   70|       |
   71|    354|  val = mem[1] << 8;
   72|    354|  val |= mem[0];
   73|    354|  return val;
   74|    354|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    313|static uint32_t mem_get_le24(const void* vmem) {
   77|    313|  uint32_t val;
   78|    313|  const uint8_t* mem = (const uint8_t*)vmem;
   79|       |
   80|    313|  val = mem[2] << 16;
   81|    313|  val |= mem[1] << 8;
   82|    313|  val |= mem[0];
   83|    313|  return val;
   84|    313|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    357|static inline uint32_t mem_get_le32(const void* vmem) {
   87|    357|  uint32_t val;
   88|    357|  const uint8_t* mem = (const uint8_t*)vmem;
   89|       |
   90|    357|  val = mem[3] << 24;
   91|    357|  val |= mem[2] << 16;
   92|    357|  val |= mem[1] << 8;
   93|    357|  val |= mem[0];
   94|    357|  return val;
   95|    357|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  465|   122M|  inline int rans_read() {
  466|   122M|    unsigned rem;
  467|   122M|    unsigned quo;
  468|   122M|    struct rans_dec_sym sym;
  469|   122M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 109M, False: 13.1M]
  |  Branch (469:40): [True: 37.2k, False: 109M]
  ------------------
  470|  37.2k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  37.2k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  37.2k|    }
  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|   122M|    quo = ans_.state / rans_precision;
  475|   122M|    rem = ans_.state % rans_precision;
  476|   122M|    fetch_sym(&sym, rem);
  477|   122M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   122M|    return sym.val;
  479|   122M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  508|   122M|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   122M|    uint32_t symbol = lut_table_[rem];
  510|   122M|    out->val = symbol;
  511|   122M|    out->prob = probability_table_[symbol].prob;
  512|   122M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   122M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  459|  1.50k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    197|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  484|    125|                                       uint32_t num_symbols) {
  485|    125|    lut_table_.resize(rans_precision);
  486|    125|    probability_table_.resize(num_symbols);
  487|    125|    uint32_t cum_prob = 0;
  488|    125|    uint32_t act_prob = 0;
  489|  6.73k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 6.63k, False: 104]
  ------------------
  490|  6.63k|      probability_table_[i].prob = token_probs[i];
  491|  6.63k|      probability_table_[i].cum_prob = cum_prob;
  492|  6.63k|      cum_prob += token_probs[i];
  493|  6.63k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 21, False: 6.61k]
  ------------------
  494|     21|        return false;
  495|     21|      }
  496|   778k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 771k, False: 6.61k]
  ------------------
  497|   771k|        lut_table_[j] = i;
  498|   771k|      }
  499|  6.61k|      act_prob = cum_prob;
  500|  6.61k|    }
  501|    104|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 20, False: 84]
  ------------------
  502|     20|      return false;
  503|     20|    }
  504|     84|    return true;
  505|    104|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     73|  inline int read_init(const uint8_t* const buf, int offset) {
  422|     73|    unsigned x;
  423|     73|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 2, False: 71]
  ------------------
  424|      2|      return 1;
  425|      2|    }
  426|     71|    ans_.buf = buf;
  427|     71|    x = buf[offset - 1] >> 6;
  428|     71|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 26, False: 45]
  ------------------
  429|     26|      ans_.buf_offset = offset - 1;
  430|     26|      ans_.state = buf[offset - 1] & 0x3F;
  431|     45|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 12, False: 33]
  ------------------
  432|     12|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 12]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     33|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 23, False: 10]
  ------------------
  438|     23|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 12, False: 11]
  ------------------
  439|     12|        return 1;
  440|     12|      }
  441|     11|      ans_.buf_offset = offset - 3;
  442|     11|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     11|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 10, False: 0]
  ------------------
  444|     10|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 1, False: 9]
  ------------------
  445|      1|        return 1;
  446|      1|      }
  447|      9|      ans_.buf_offset = offset - 4;
  448|      9|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|      9|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     58|    ans_.state += l_rans_base;
  453|     58|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     58|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 9, False: 49]
  ------------------
  454|      9|      return 1;
  455|      9|    }
  456|     49|    return 0;
  457|     58|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  465|   161k|  inline int rans_read() {
  466|   161k|    unsigned rem;
  467|   161k|    unsigned quo;
  468|   161k|    struct rans_dec_sym sym;
  469|   163k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 60.5k, False: 102k]
  |  Branch (469:40): [True: 1.31k, False: 59.2k]
  ------------------
  470|  1.31k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.31k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.31k|    }
  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|     49|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    274|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  484|    174|                                       uint32_t num_symbols) {
  485|    174|    lut_table_.resize(rans_precision);
  486|    174|    probability_table_.resize(num_symbols);
  487|    174|    uint32_t cum_prob = 0;
  488|    174|    uint32_t act_prob = 0;
  489|  7.39k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 7.24k, False: 152]
  ------------------
  490|  7.24k|      probability_table_[i].prob = token_probs[i];
  491|  7.24k|      probability_table_[i].cum_prob = cum_prob;
  492|  7.24k|      cum_prob += token_probs[i];
  493|  7.24k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 22, False: 7.22k]
  ------------------
  494|     22|        return false;
  495|     22|      }
  496|  4.71M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 4.70M, False: 7.22k]
  ------------------
  497|  4.70M|        lut_table_[j] = i;
  498|  4.70M|      }
  499|  7.22k|      act_prob = cum_prob;
  500|  7.22k|    }
  501|    152|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 19, False: 133]
  ------------------
  502|     19|      return false;
  503|     19|    }
  504|    133|    return true;
  505|    152|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|    104|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    104|    unsigned x;
  423|    104|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 98]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     98|    ans_.buf = buf;
  427|     98|    x = buf[offset - 1] >> 6;
  428|     98|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 40, False: 58]
  ------------------
  429|     40|      ans_.buf_offset = offset - 1;
  430|     40|      ans_.state = buf[offset - 1] & 0x3F;
  431|     58|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 23, False: 35]
  ------------------
  432|     23|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 5, False: 18]
  ------------------
  433|      5|        return 1;
  434|      5|      }
  435|     18|      ans_.buf_offset = offset - 2;
  436|     18|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     35|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 22, False: 13]
  ------------------
  438|     22|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 21]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|     21|      ans_.buf_offset = offset - 3;
  442|     21|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     21|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 13, False: 0]
  ------------------
  444|     13|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 0, False: 13]
  ------------------
  445|      0|        return 1;
  446|      0|      }
  447|     13|      ans_.buf_offset = offset - 4;
  448|     13|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     13|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     92|    ans_.state += l_rans_base;
  453|     92|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     92|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 11, False: 81]
  ------------------
  454|     11|      return 1;
  455|     11|    }
  456|     81|    return 0;
  457|     92|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  465|   548k|  inline int rans_read() {
  466|   548k|    unsigned rem;
  467|   548k|    unsigned quo;
  468|   548k|    struct rans_dec_sym sym;
  469|   549k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 542k, False: 7.43k]
  |  Branch (469:40): [True: 1.17k, False: 540k]
  ------------------
  470|  1.17k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.17k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.17k|    }
  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|   548k|    quo = ans_.state / rans_precision;
  475|   548k|    rem = ans_.state % rans_precision;
  476|   548k|    fetch_sym(&sym, rem);
  477|   548k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   548k|    return sym.val;
  479|   548k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  508|   548k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   548k|    uint32_t symbol = lut_table_[rem];
  510|   548k|    out->val = symbol;
  511|   548k|    out->prob = probability_table_[symbol].prob;
  512|   548k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   548k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  459|     81|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    309|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  484|    191|                                       uint32_t num_symbols) {
  485|    191|    lut_table_.resize(rans_precision);
  486|    191|    probability_table_.resize(num_symbols);
  487|    191|    uint32_t cum_prob = 0;
  488|    191|    uint32_t act_prob = 0;
  489|  12.1k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 11.9k, False: 164]
  ------------------
  490|  11.9k|      probability_table_[i].prob = token_probs[i];
  491|  11.9k|      probability_table_[i].cum_prob = cum_prob;
  492|  11.9k|      cum_prob += token_probs[i];
  493|  11.9k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 27, False: 11.9k]
  ------------------
  494|     27|        return false;
  495|     27|      }
  496|  10.6M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 10.6M, False: 11.9k]
  ------------------
  497|  10.6M|        lut_table_[j] = i;
  498|  10.6M|      }
  499|  11.9k|      act_prob = cum_prob;
  500|  11.9k|    }
  501|    164|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 25, False: 139]
  ------------------
  502|     25|      return false;
  503|     25|    }
  504|    139|    return true;
  505|    164|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     83|  inline int read_init(const uint8_t* const buf, int offset) {
  422|     83|    unsigned x;
  423|     83|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 80]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     80|    ans_.buf = buf;
  427|     80|    x = buf[offset - 1] >> 6;
  428|     80|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 24, False: 56]
  ------------------
  429|     24|      ans_.buf_offset = offset - 1;
  430|     24|      ans_.state = buf[offset - 1] & 0x3F;
  431|     56|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 16, False: 40]
  ------------------
  432|     16|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 7]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     40|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 19, False: 21]
  ------------------
  438|     19|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 12, False: 7]
  ------------------
  439|     12|        return 1;
  440|     12|      }
  441|      7|      ans_.buf_offset = offset - 3;
  442|      7|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     21|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 21, False: 0]
  ------------------
  444|     21|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 4, False: 17]
  ------------------
  445|      4|        return 1;
  446|      4|      }
  447|     17|      ans_.buf_offset = offset - 4;
  448|     17|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     17|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     55|    ans_.state += l_rans_base;
  453|     55|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     55|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 11, False: 44]
  ------------------
  454|     11|      return 1;
  455|     11|    }
  456|     44|    return 0;
  457|     55|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  465|  32.7k|  inline int rans_read() {
  466|  32.7k|    unsigned rem;
  467|  32.7k|    unsigned quo;
  468|  32.7k|    struct rans_dec_sym sym;
  469|  33.0k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 31.8k, False: 1.27k]
  |  Branch (469:40): [True: 385, False: 31.4k]
  ------------------
  470|    385|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    385|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    385|    }
  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|  32.7k|    quo = ans_.state / rans_precision;
  475|  32.7k|    rem = ans_.state % rans_precision;
  476|  32.7k|    fetch_sym(&sym, rem);
  477|  32.7k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|  32.7k|    return sym.val;
  479|  32.7k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  508|  32.7k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|  32.7k|    uint32_t symbol = lut_table_[rem];
  510|  32.7k|    out->val = symbol;
  511|  32.7k|    out->prob = probability_table_[symbol].prob;
  512|  32.7k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|  32.7k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  459|     44|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    321|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  484|    203|                                       uint32_t num_symbols) {
  485|    203|    lut_table_.resize(rans_precision);
  486|    203|    probability_table_.resize(num_symbols);
  487|    203|    uint32_t cum_prob = 0;
  488|    203|    uint32_t act_prob = 0;
  489|  6.21k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 6.03k, False: 177]
  ------------------
  490|  6.03k|      probability_table_[i].prob = token_probs[i];
  491|  6.03k|      probability_table_[i].cum_prob = cum_prob;
  492|  6.03k|      cum_prob += token_probs[i];
  493|  6.03k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 26, False: 6.00k]
  ------------------
  494|     26|        return false;
  495|     26|      }
  496|  40.7M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 40.7M, False: 6.00k]
  ------------------
  497|  40.7M|        lut_table_[j] = i;
  498|  40.7M|      }
  499|  6.00k|      act_prob = cum_prob;
  500|  6.00k|    }
  501|    177|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 31, False: 146]
  ------------------
  502|     31|      return false;
  503|     31|    }
  504|    146|    return true;
  505|    177|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|    101|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    101|    unsigned x;
  423|    101|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 95]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     95|    ans_.buf = buf;
  427|     95|    x = buf[offset - 1] >> 6;
  428|     95|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 29, False: 66]
  ------------------
  429|     29|      ans_.buf_offset = offset - 1;
  430|     29|      ans_.state = buf[offset - 1] & 0x3F;
  431|     66|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 9, False: 57]
  ------------------
  432|      9|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 9]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      9|      ans_.buf_offset = offset - 2;
  436|      9|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     57|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 25, False: 32]
  ------------------
  438|     25|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 7, False: 18]
  ------------------
  439|      7|        return 1;
  440|      7|      }
  441|     18|      ans_.buf_offset = offset - 3;
  442|     18|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     32|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 32, False: 0]
  ------------------
  444|     32|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 8, False: 24]
  ------------------
  445|      8|        return 1;
  446|      8|      }
  447|     24|      ans_.buf_offset = offset - 4;
  448|     24|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     24|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     80|    ans_.state += l_rans_base;
  453|     80|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     80|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 11, False: 69]
  ------------------
  454|     11|      return 1;
  455|     11|    }
  456|     69|    return 0;
  457|     80|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  465|   302k|  inline int rans_read() {
  466|   302k|    unsigned rem;
  467|   302k|    unsigned quo;
  468|   302k|    struct rans_dec_sym sym;
  469|   303k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 224k, False: 78.7k]
  |  Branch (469:40): [True: 858, False: 224k]
  ------------------
  470|    858|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    858|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    858|    }
  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|   302k|    quo = ans_.state / rans_precision;
  475|   302k|    rem = ans_.state % rans_precision;
  476|   302k|    fetch_sym(&sym, rem);
  477|   302k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   302k|    return sym.val;
  479|   302k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  508|   302k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   302k|    uint32_t symbol = lut_table_[rem];
  510|   302k|    out->val = symbol;
  511|   302k|    out->prob = probability_table_[symbol].prob;
  512|   302k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   302k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  459|     69|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    362|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  484|    245|                                       uint32_t num_symbols) {
  485|    245|    lut_table_.resize(rans_precision);
  486|    245|    probability_table_.resize(num_symbols);
  487|    245|    uint32_t cum_prob = 0;
  488|    245|    uint32_t act_prob = 0;
  489|  4.83k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 4.62k, False: 216]
  ------------------
  490|  4.62k|      probability_table_[i].prob = token_probs[i];
  491|  4.62k|      probability_table_[i].cum_prob = cum_prob;
  492|  4.62k|      cum_prob += token_probs[i];
  493|  4.62k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 29, False: 4.59k]
  ------------------
  494|     29|        return false;
  495|     29|      }
  496|   100M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 100M, False: 4.59k]
  ------------------
  497|   100M|        lut_table_[j] = i;
  498|   100M|      }
  499|  4.59k|      act_prob = cum_prob;
  500|  4.59k|    }
  501|    216|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 46, False: 170]
  ------------------
  502|     46|      return false;
  503|     46|    }
  504|    170|    return true;
  505|    216|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     97|  inline int read_init(const uint8_t* const buf, int offset) {
  422|     97|    unsigned x;
  423|     97|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 17, False: 80]
  ------------------
  424|     17|      return 1;
  425|     17|    }
  426|     80|    ans_.buf = buf;
  427|     80|    x = buf[offset - 1] >> 6;
  428|     80|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 30, False: 50]
  ------------------
  429|     30|      ans_.buf_offset = offset - 1;
  430|     30|      ans_.state = buf[offset - 1] & 0x3F;
  431|     50|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 42]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 7]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     42|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 6, False: 36]
  ------------------
  438|      6|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 6]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      6|      ans_.buf_offset = offset - 3;
  442|      6|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     36|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 36, False: 0]
  ------------------
  444|     36|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 1, False: 35]
  ------------------
  445|      1|        return 1;
  446|      1|      }
  447|     35|      ans_.buf_offset = offset - 4;
  448|     35|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     35|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     78|    ans_.state += l_rans_base;
  453|     78|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     78|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 19, False: 59]
  ------------------
  454|     19|      return 1;
  455|     19|    }
  456|     59|    return 0;
  457|     78|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  465|   491k|  inline int rans_read() {
  466|   491k|    unsigned rem;
  467|   491k|    unsigned quo;
  468|   491k|    struct rans_dec_sym sym;
  469|   492k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 334k, False: 158k]
  |  Branch (469:40): [True: 1.21k, False: 332k]
  ------------------
  470|  1.21k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.21k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.21k|    }
  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|   491k|    quo = ans_.state / rans_precision;
  475|   491k|    rem = ans_.state % rans_precision;
  476|   491k|    fetch_sym(&sym, rem);
  477|   491k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   491k|    return sym.val;
  479|   491k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  508|   491k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   491k|    uint32_t symbol = lut_table_[rem];
  510|   491k|    out->val = symbol;
  511|   491k|    out->prob = probability_table_[symbol].prob;
  512|   491k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   491k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  459|     59|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.52k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  484|    953|                                       uint32_t num_symbols) {
  485|    953|    lut_table_.resize(rans_precision);
  486|    953|    probability_table_.resize(num_symbols);
  487|    953|    uint32_t cum_prob = 0;
  488|    953|    uint32_t act_prob = 0;
  489|  21.5k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 20.6k, False: 905]
  ------------------
  490|  20.6k|      probability_table_[i].prob = token_probs[i];
  491|  20.6k|      probability_table_[i].cum_prob = cum_prob;
  492|  20.6k|      cum_prob += token_probs[i];
  493|  20.6k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 48, False: 20.6k]
  ------------------
  494|     48|        return false;
  495|     48|      }
  496|   894M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 894M, False: 20.6k]
  ------------------
  497|   894M|        lut_table_[j] = i;
  498|   894M|      }
  499|  20.6k|      act_prob = cum_prob;
  500|  20.6k|    }
  501|    905|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 78, False: 827]
  ------------------
  502|     78|      return false;
  503|     78|    }
  504|    827|    return true;
  505|    905|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    499|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    499|    unsigned x;
  423|    499|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 19, False: 480]
  ------------------
  424|     19|      return 1;
  425|     19|    }
  426|    480|    ans_.buf = buf;
  427|    480|    x = buf[offset - 1] >> 6;
  428|    480|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 121, False: 359]
  ------------------
  429|    121|      ans_.buf_offset = offset - 1;
  430|    121|      ans_.state = buf[offset - 1] & 0x3F;
  431|    359|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 91, False: 268]
  ------------------
  432|     91|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 29, False: 62]
  ------------------
  433|     29|        return 1;
  434|     29|      }
  435|     62|      ans_.buf_offset = offset - 2;
  436|     62|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    268|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 81, False: 187]
  ------------------
  438|     81|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 13, False: 68]
  ------------------
  439|     13|        return 1;
  440|     13|      }
  441|     68|      ans_.buf_offset = offset - 3;
  442|     68|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    187|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 187, False: 0]
  ------------------
  444|    187|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 31, False: 156]
  ------------------
  445|     31|        return 1;
  446|     31|      }
  447|    156|      ans_.buf_offset = offset - 4;
  448|    156|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|    156|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    407|    ans_.state += l_rans_base;
  453|    407|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    407|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 30, False: 377]
  ------------------
  454|     30|      return 1;
  455|     30|    }
  456|    377|    return 0;
  457|    407|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  465|   144M|  inline int rans_read() {
  466|   144M|    unsigned rem;
  467|   144M|    unsigned quo;
  468|   144M|    struct rans_dec_sym sym;
  469|   144M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 125M, False: 19.3M]
  |  Branch (469:40): [True: 8.30k, False: 125M]
  ------------------
  470|  8.30k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  8.30k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  8.30k|    }
  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|   144M|    quo = ans_.state / rans_precision;
  475|   144M|    rem = ans_.state % rans_precision;
  476|   144M|    fetch_sym(&sym, rem);
  477|   144M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   144M|    return sym.val;
  479|   144M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  508|   144M|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   144M|    uint32_t symbol = lut_table_[rem];
  510|   144M|    out->val = symbol;
  511|   144M|    out->prob = probability_table_[symbol].prob;
  512|   144M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   144M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  459|    377|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.40k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.40k|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.40k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.40k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.40k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.40k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.40k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 99, False: 1.30k]
  ------------------
   67|     99|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 95]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     99|  } else
   72|  1.30k|#endif
   73|  1.30k|  {
   74|  1.30k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 20, False: 1.28k]
  ------------------
   75|     20|      return false;
   76|     20|    }
   77|  1.30k|  }
   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.38k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 94, False: 1.28k]
  ------------------
   83|     94|    return false;
   84|     94|  }
   85|  1.28k|  probability_table_.resize(num_symbols_);
   86|  1.28k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 478, False: 809]
  ------------------
   87|    478|    return true;
   88|    478|  }
   89|       |  // Decode the table.
   90|   566k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 566k, False: 586]
  ------------------
   91|   566k|    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|   566k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 65, False: 565k]
  ------------------
   95|     65|      return false;
   96|     65|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   565k|    const int token = prob_data & 3;
  102|   565k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 210k, False: 355k]
  ------------------
  103|   210k|      const uint32_t offset = prob_data >> 2;
  104|   210k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 125, False: 210k]
  ------------------
  105|    125|        return false;
  106|    125|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.98M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.77M, False: 210k]
  ------------------
  109|  5.77M|        probability_table_[i + j] = 0;
  110|  5.77M|      }
  111|   210k|      i += offset;
  112|   355k|    } else {
  113|   355k|      const int extra_bytes = token;
  114|   355k|      uint32_t prob = prob_data >> 2;
  115|   684k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 329k, False: 355k]
  ------------------
  116|   329k|        uint8_t eb;
  117|   329k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 33, False: 329k]
  ------------------
  118|     33|          return false;
  119|     33|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   329k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   329k|      }
  124|   355k|      probability_table_[i] = prob;
  125|   355k|    }
  126|   565k|  }
  127|    586|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 202, False: 384]
  ------------------
  128|    202|    return false;
  129|    202|  }
  130|    384|  return true;
  131|    586|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    704|    DecoderBuffer* buffer) {
  136|    704|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    704|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    704|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    704|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 69, False: 635]
  ------------------
  140|     69|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 69]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     69|  } else
  145|    635|#endif
  146|    635|  {
  147|    635|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 22, False: 613]
  ------------------
  148|     22|      return false;
  149|     22|    }
  150|    635|  }
  151|    682|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 125, False: 557]
  ------------------
  152|    125|    return false;
  153|    125|  }
  154|    557|  const uint8_t* const data_head =
  155|    557|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    557|  buffer->Advance(bytes_encoded);
  158|    557|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 127, False: 430]
  ------------------
  159|    127|    return false;
  160|    127|  }
  161|    430|  return true;
  162|    557|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    603|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  4.74M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    359|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    359|  ans_.read_end();
  167|    359|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    651|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    651|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    651|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 651]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    651|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    651|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    651|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 50, False: 601]
  ------------------
   67|     50|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 47]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     50|  } else
   72|    601|#endif
   73|    601|  {
   74|    601|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 599]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    601|  }
   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|    646|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 45, False: 601]
  ------------------
   83|     45|    return false;
   84|     45|  }
   85|    601|  probability_table_.resize(num_symbols_);
   86|    601|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 17, False: 584]
  ------------------
   87|     17|    return true;
   88|     17|  }
   89|       |  // Decode the table.
   90|  3.21M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.21M, False: 426]
  ------------------
   91|  3.21M|    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.21M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 48, False: 3.21M]
  ------------------
   95|     48|      return false;
   96|     48|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  3.21M|    const int token = prob_data & 3;
  102|  3.21M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.02M, False: 2.19M]
  ------------------
  103|  1.02M|      const uint32_t offset = prob_data >> 2;
  104|  1.02M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 84, False: 1.02M]
  ------------------
  105|     84|        return false;
  106|     84|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  32.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 30.9M, False: 1.02M]
  ------------------
  109|  30.9M|        probability_table_[i + j] = 0;
  110|  30.9M|      }
  111|  1.02M|      i += offset;
  112|  2.19M|    } else {
  113|  2.19M|      const int extra_bytes = token;
  114|  2.19M|      uint32_t prob = prob_data >> 2;
  115|  2.21M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 26.7k, False: 2.19M]
  ------------------
  116|  26.7k|        uint8_t eb;
  117|  26.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 26.7k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  26.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  26.7k|      }
  124|  2.19M|      probability_table_[i] = prob;
  125|  2.19M|    }
  126|  3.21M|  }
  127|    426|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 152, False: 274]
  ------------------
  128|    152|    return false;
  129|    152|  }
  130|    274|  return true;
  131|    426|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    291|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    274|    DecoderBuffer* buffer) {
  136|    274|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    274|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    274|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    274|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 273]
  ------------------
  140|      1|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      1|  } else
  145|    273|#endif
  146|    273|  {
  147|    273|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 263]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    273|  }
  151|    264|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 255]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|    255|  const uint8_t* const data_head =
  155|    255|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    255|  buffer->Advance(bytes_encoded);
  158|    255|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 14, False: 241]
  ------------------
  159|     14|    return false;
  160|     14|  }
  161|    241|  return true;
  162|    255|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  70.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    241|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    241|  ans_.read_end();
  167|    241|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    397|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    397|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    397|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 397]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    397|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    397|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    397|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 382]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 15]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     15|  } else
   72|    382|#endif
   73|    382|  {
   74|    382|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 380]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    382|  }
   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|    395|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 376]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    376|  probability_table_.resize(num_symbols_);
   86|    376|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 369]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|   801k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 800k, False: 292]
  ------------------
   91|   800k|    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|   800k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 800k]
  ------------------
   95|     34|      return false;
   96|     34|    }
   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|   800k|    const int token = prob_data & 3;
  102|   800k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 439k, False: 361k]
  ------------------
  103|   439k|      const uint32_t offset = prob_data >> 2;
  104|   439k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 439k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  13.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 13.1M, False: 439k]
  ------------------
  109|  13.1M|        probability_table_[i + j] = 0;
  110|  13.1M|      }
  111|   439k|      i += offset;
  112|   439k|    } else {
  113|   361k|      const int extra_bytes = token;
  114|   361k|      uint32_t prob = prob_data >> 2;
  115|   664k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 302k, False: 361k]
  ------------------
  116|   302k|        uint8_t eb;
  117|   302k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 302k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   302k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   302k|      }
  124|   361k|      probability_table_[i] = prob;
  125|   361k|    }
  126|   800k|  }
  127|    292|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 269]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    269|  return true;
  131|    292|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    276|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    269|    DecoderBuffer* buffer) {
  136|    269|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    269|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    269|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    269|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 6, False: 263]
  ------------------
  140|      6|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 6]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      6|  } else
  145|    263|#endif
  146|    263|  {
  147|    263|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 11, False: 252]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|    263|  }
  151|    258|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 238]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|    238|  const uint8_t* const data_head =
  155|    238|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    238|  buffer->Advance(bytes_encoded);
  158|    238|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 16, False: 222]
  ------------------
  159|     16|    return false;
  160|     16|  }
  161|    222|  return true;
  162|    238|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  5.09M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    222|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    222|  ans_.read_end();
  167|    222|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    278|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    278|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    278|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 278]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    278|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    278|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    278|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 43, False: 235]
  ------------------
   67|     43|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 43]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     43|  } else
   72|    235|#endif
   73|    235|  {
   74|    235|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 232]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    235|  }
   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|    275|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 259]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    259|  probability_table_.resize(num_symbols_);
   86|    259|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 254]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  10.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 10.2k, False: 189]
  ------------------
   91|  10.2k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  10.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 10.2k]
  ------------------
   95|     32|      return false;
   96|     32|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  10.2k|    const int token = prob_data & 3;
  102|  10.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.78k, False: 4.46k]
  ------------------
  103|  5.78k|      const uint32_t offset = prob_data >> 2;
  104|  5.78k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 17, False: 5.76k]
  ------------------
  105|     17|        return false;
  106|     17|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   211k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 205k, False: 5.76k]
  ------------------
  109|   205k|        probability_table_[i + j] = 0;
  110|   205k|      }
  111|  5.76k|      i += offset;
  112|  5.76k|    } else {
  113|  4.46k|      const int extra_bytes = token;
  114|  4.46k|      uint32_t prob = prob_data >> 2;
  115|  7.72k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.27k, False: 4.45k]
  ------------------
  116|  3.27k|        uint8_t eb;
  117|  3.27k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 3.26k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.26k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.26k|      }
  124|  4.45k|      probability_table_[i] = prob;
  125|  4.45k|    }
  126|  10.2k|  }
  127|    189|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 24, False: 165]
  ------------------
  128|     24|    return false;
  129|     24|  }
  130|    165|  return true;
  131|    189|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    170|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    165|    DecoderBuffer* buffer) {
  136|    165|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    165|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    165|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    165|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 35, False: 130]
  ------------------
  140|     35|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 32]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     35|  } else
  145|    130|#endif
  146|    130|  {
  147|    130|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 130]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    130|  }
  151|    162|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 44, False: 118]
  ------------------
  152|     44|    return false;
  153|     44|  }
  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: 31, False: 87]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|     87|  return true;
  162|    118|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  15.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|     87|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     87|  ans_.read_end();
  167|     87|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    309|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    309|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    309|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 309]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    309|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    309|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    309|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 28, False: 281]
  ------------------
   67|     28|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 27]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     28|  } else
   72|    281|#endif
   73|    281|  {
   74|    281|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 281]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    281|  }
   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|    308|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 298]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    298|  probability_table_.resize(num_symbols_);
   86|    298|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 287]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  6.42k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.21k, False: 218]
  ------------------
   91|  6.21k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  6.21k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 6.17k]
  ------------------
   95|     36|      return false;
   96|     36|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  6.17k|    const int token = prob_data & 3;
  102|  6.17k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.09k, False: 3.08k]
  ------------------
  103|  3.09k|      const uint32_t offset = prob_data >> 2;
  104|  3.09k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 3.06k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   108k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 105k, False: 3.06k]
  ------------------
  109|   105k|        probability_table_[i + j] = 0;
  110|   105k|      }
  111|  3.06k|      i += offset;
  112|  3.08k|    } else {
  113|  3.08k|      const int extra_bytes = token;
  114|  3.08k|      uint32_t prob = prob_data >> 2;
  115|  5.60k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.52k, False: 3.07k]
  ------------------
  116|  2.52k|        uint8_t eb;
  117|  2.52k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 2.51k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.51k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.51k|      }
  124|  3.07k|      probability_table_[i] = prob;
  125|  3.07k|    }
  126|  6.17k|  }
  127|    218|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 29, False: 189]
  ------------------
  128|     29|    return false;
  129|     29|  }
  130|    189|  return true;
  131|    218|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    200|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    189|    DecoderBuffer* buffer) {
  136|    189|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    189|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    189|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    189|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 24, False: 165]
  ------------------
  140|     24|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 22]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     24|  } else
  145|    165|#endif
  146|    165|  {
  147|    165|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 164]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    165|  }
  151|    186|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 25, False: 161]
  ------------------
  152|     25|    return false;
  153|     25|  }
  154|    161|  const uint8_t* const data_head =
  155|    161|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    161|  buffer->Advance(bytes_encoded);
  158|    161|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 23, False: 138]
  ------------------
  159|     23|    return false;
  160|     23|  }
  161|    138|  return true;
  162|    161|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  3.06M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    138|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    138|  ans_.read_end();
  167|    138|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    408|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    408|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    408|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 408]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    408|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    408|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    408|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 18, False: 390]
  ------------------
   67|     18|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 18]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     18|  } else
   72|    390|#endif
   73|    390|  {
   74|    390|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 389]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    390|  }
   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|    407|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 406]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|    406|  probability_table_.resize(num_symbols_);
   86|    406|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 404]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  17.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 17.2k, False: 338]
  ------------------
   91|  17.2k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  17.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 17.1k]
  ------------------
   95|     31|      return false;
   96|     31|    }
   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|  17.1k|    const int token = prob_data & 3;
  102|  17.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.34k, False: 9.83k]
  ------------------
  103|  7.34k|      const uint32_t offset = prob_data >> 2;
  104|  7.34k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 23, False: 7.31k]
  ------------------
  105|     23|        return false;
  106|     23|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   258k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 251k, False: 7.31k]
  ------------------
  109|   251k|        probability_table_[i + j] = 0;
  110|   251k|      }
  111|  7.31k|      i += offset;
  112|  9.83k|    } else {
  113|  9.83k|      const int extra_bytes = token;
  114|  9.83k|      uint32_t prob = prob_data >> 2;
  115|  16.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.88k, False: 9.82k]
  ------------------
  116|  6.88k|        uint8_t eb;
  117|  6.88k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 6.87k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.87k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.87k|      }
  124|  9.82k|      probability_table_[i] = prob;
  125|  9.82k|    }
  126|  17.1k|  }
  127|    338|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 28, False: 310]
  ------------------
  128|     28|    return false;
  129|     28|  }
  130|    310|  return true;
  131|    338|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    312|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    310|    DecoderBuffer* buffer) {
  136|    310|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    310|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    310|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    310|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 17, False: 293]
  ------------------
  140|     17|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 16]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     17|  } else
  145|    293|#endif
  146|    293|  {
  147|    293|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 293]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    293|  }
  151|    309|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 24, False: 285]
  ------------------
  152|     24|    return false;
  153|     24|  }
  154|    285|  const uint8_t* const data_head =
  155|    285|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    285|  buffer->Advance(bytes_encoded);
  158|    285|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 250]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|    250|  return true;
  162|    285|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  10.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    250|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    250|  ans_.read_end();
  167|    250|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    318|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    318|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    318|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 318]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    318|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    318|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    318|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 28, False: 290]
  ------------------
   67|     28|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 28]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     28|  } else
   72|    290|#endif
   73|    290|  {
   74|    290|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 280]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    290|  }
   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|    308|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 298]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    298|  probability_table_.resize(num_symbols_);
   86|    298|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 296]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   160k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 160k, False: 214]
  ------------------
   91|   160k|    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|   160k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 37, False: 160k]
  ------------------
   95|     37|      return false;
   96|     37|    }
   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|   160k|    const int token = prob_data & 3;
  102|   160k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 48.0k, False: 112k]
  ------------------
  103|  48.0k|      const uint32_t offset = prob_data >> 2;
  104|  48.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 48.0k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.94M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.89M, False: 48.0k]
  ------------------
  109|  1.89M|        probability_table_[i + j] = 0;
  110|  1.89M|      }
  111|  48.0k|      i += offset;
  112|   112k|    } else {
  113|   112k|      const int extra_bytes = token;
  114|   112k|      uint32_t prob = prob_data >> 2;
  115|   172k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 60.3k, False: 112k]
  ------------------
  116|  60.3k|        uint8_t eb;
  117|  60.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 60.3k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  60.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  60.3k|      }
  124|   112k|      probability_table_[i] = prob;
  125|   112k|    }
  126|   160k|  }
  127|    214|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 193]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    193|  return true;
  131|    214|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    195|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    193|    DecoderBuffer* buffer) {
  136|    193|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    193|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    193|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    193|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 170]
  ------------------
  140|     23|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 21]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     23|  } else
  145|    170|#endif
  146|    170|  {
  147|    170|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 170]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    170|  }
  151|    191|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 32, False: 159]
  ------------------
  152|     32|    return false;
  153|     32|  }
  154|    159|  const uint8_t* const data_head =
  155|    159|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    159|  buffer->Advance(bytes_encoded);
  158|    159|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 32, False: 127]
  ------------------
  159|     32|    return false;
  160|     32|  }
  161|    127|  return true;
  162|    159|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  11.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    127|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    127|  ans_.read_end();
  167|    127|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    211|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    211|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    211|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 211]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    211|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    211|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    211|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 3, False: 208]
  ------------------
   67|      3|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 3]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      3|  } else
   72|    208|#endif
   73|    208|  {
   74|    208|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 15, False: 193]
  ------------------
   75|     15|      return false;
   76|     15|    }
   77|    208|  }
   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|    196|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 194]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    194|  probability_table_.resize(num_symbols_);
   86|    194|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 194]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  39.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 39.5k, False: 123]
  ------------------
   91|  39.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|  39.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 39.4k]
  ------------------
   95|     32|      return false;
   96|     32|    }
   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|  39.4k|    const int token = prob_data & 3;
  102|  39.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 16.8k, False: 22.6k]
  ------------------
  103|  16.8k|      const uint32_t offset = prob_data >> 2;
  104|  16.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 19, False: 16.7k]
  ------------------
  105|     19|        return false;
  106|     19|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   518k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 501k, False: 16.7k]
  ------------------
  109|   501k|        probability_table_[i + j] = 0;
  110|   501k|      }
  111|  16.7k|      i += offset;
  112|  22.6k|    } else {
  113|  22.6k|      const int extra_bytes = token;
  114|  22.6k|      uint32_t prob = prob_data >> 2;
  115|  36.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 14.0k, False: 22.6k]
  ------------------
  116|  14.0k|        uint8_t eb;
  117|  14.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 14.0k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  14.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  14.0k|      }
  124|  22.6k|      probability_table_[i] = prob;
  125|  22.6k|    }
  126|  39.4k|  }
  127|    123|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 103]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    103|  return true;
  131|    123|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    103|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    103|    DecoderBuffer* buffer) {
  136|    103|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    103|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    103|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    103|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 100]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|    100|#endif
  146|    100|  {
  147|    100|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 99]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    100|  }
  151|    102|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 93]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|     93|  const uint8_t* const data_head =
  155|     93|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     93|  buffer->Advance(bytes_encoded);
  158|     93|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 17, False: 76]
  ------------------
  159|     17|    return false;
  160|     17|  }
  161|     76|  return true;
  162|     93|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|   572k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     76|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     76|  ans_.read_end();
  167|     76|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    197|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    197|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    197|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 197]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    197|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    197|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    197|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 187]
  ------------------
   67|     10|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 10]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     10|  } else
   72|    187|#endif
   73|    187|  {
   74|    187|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 184]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    187|  }
   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|    194|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 190]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    190|  probability_table_.resize(num_symbols_);
   86|    190|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 188]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  21.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 21.8k, False: 125]
  ------------------
   91|  21.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|  21.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 21.8k]
  ------------------
   95|     27|      return false;
   96|     27|    }
   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|  21.8k|    const int token = prob_data & 3;
  102|  21.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 8.09k, False: 13.7k]
  ------------------
  103|  8.09k|      const uint32_t offset = prob_data >> 2;
  104|  8.09k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 8.06k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   227k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 219k, False: 8.06k]
  ------------------
  109|   219k|        probability_table_[i + j] = 0;
  110|   219k|      }
  111|  8.06k|      i += offset;
  112|  13.7k|    } else {
  113|  13.7k|      const int extra_bytes = token;
  114|  13.7k|      uint32_t prob = prob_data >> 2;
  115|  25.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 11.3k, False: 13.7k]
  ------------------
  116|  11.3k|        uint8_t eb;
  117|  11.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 11.3k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  11.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  11.3k|      }
  124|  13.7k|      probability_table_[i] = prob;
  125|  13.7k|    }
  126|  21.8k|  }
  127|    125|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 41, False: 84]
  ------------------
  128|     41|    return false;
  129|     41|  }
  130|     84|  return true;
  131|    125|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|     86|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|     84|    DecoderBuffer* buffer) {
  136|     84|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     84|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     84|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     84|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 84]
  ------------------
  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|     84|#endif
  146|     84|  {
  147|     84|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 83]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     84|  }
  151|     83|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 10, False: 73]
  ------------------
  152|     10|    return false;
  153|     10|  }
  154|     73|  const uint8_t* const data_head =
  155|     73|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     73|  buffer->Advance(bytes_encoded);
  158|     73|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 24, False: 49]
  ------------------
  159|     24|    return false;
  160|     24|  }
  161|     49|  return true;
  162|     73|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   161k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     49|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     49|  ans_.read_end();
  167|     49|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    274|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    274|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    274|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 274]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    274|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    274|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    274|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 5, False: 269]
  ------------------
   67|      5|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 5]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      5|  } else
   72|    269|#endif
   73|    269|  {
   74|    269|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 266]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    269|  }
   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|    271|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 268]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    268|  probability_table_.resize(num_symbols_);
   86|    268|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 263]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   101k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 100k, False: 174]
  ------------------
   91|   100k|    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|   100k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 100k]
  ------------------
   95|     36|      return false;
   96|     36|    }
   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|   100k|    const int token = prob_data & 3;
  102|   100k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 38.2k, False: 62.6k]
  ------------------
  103|  38.2k|      const uint32_t offset = prob_data >> 2;
  104|  38.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 38.2k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.29M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.26M, False: 38.2k]
  ------------------
  109|  1.26M|        probability_table_[i + j] = 0;
  110|  1.26M|      }
  111|  38.2k|      i += offset;
  112|  62.6k|    } else {
  113|  62.6k|      const int extra_bytes = token;
  114|  62.6k|      uint32_t prob = prob_data >> 2;
  115|   110k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 48.1k, False: 62.5k]
  ------------------
  116|  48.1k|        uint8_t eb;
  117|  48.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 48.0k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  48.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  48.0k|      }
  124|  62.5k|      probability_table_[i] = prob;
  125|  62.5k|    }
  126|   100k|  }
  127|    174|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 41, False: 133]
  ------------------
  128|     41|    return false;
  129|     41|  }
  130|    133|  return true;
  131|    174|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    138|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    133|    DecoderBuffer* buffer) {
  136|    133|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    133|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    133|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    133|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 133]
  ------------------
  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|    133|#endif
  146|    133|  {
  147|    133|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 133]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    133|  }
  151|    133|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 29, False: 104]
  ------------------
  152|     29|    return false;
  153|     29|  }
  154|    104|  const uint8_t* const data_head =
  155|    104|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    104|  buffer->Advance(bytes_encoded);
  158|    104|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 23, False: 81]
  ------------------
  159|     23|    return false;
  160|     23|  }
  161|     81|  return true;
  162|    104|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   548k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     81|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     81|  ans_.read_end();
  167|     81|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    309|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    309|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    309|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 309]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    309|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    309|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    309|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 33, False: 276]
  ------------------
   67|     33|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 33]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     33|  } else
   72|    276|#endif
   73|    276|  {
   74|    276|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 274]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    276|  }
   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|    307|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 283]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    283|  probability_table_.resize(num_symbols_);
   86|    283|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 277]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  36.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 36.3k, False: 191]
  ------------------
   91|  36.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|  36.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 37, False: 36.3k]
  ------------------
   95|     37|      return false;
   96|     37|    }
   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|  36.3k|    const int token = prob_data & 3;
  102|  36.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 13.8k, False: 22.4k]
  ------------------
  103|  13.8k|      const uint32_t offset = prob_data >> 2;
  104|  13.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 13.8k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   366k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 352k, False: 13.8k]
  ------------------
  109|   352k|        probability_table_[i + j] = 0;
  110|   352k|      }
  111|  13.8k|      i += offset;
  112|  22.4k|    } else {
  113|  22.4k|      const int extra_bytes = token;
  114|  22.4k|      uint32_t prob = prob_data >> 2;
  115|  43.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 21.2k, False: 22.4k]
  ------------------
  116|  21.2k|        uint8_t eb;
  117|  21.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 21.2k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  21.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  21.2k|      }
  124|  22.4k|      probability_table_[i] = prob;
  125|  22.4k|    }
  126|  36.3k|  }
  127|    191|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 52, False: 139]
  ------------------
  128|     52|    return false;
  129|     52|  }
  130|    139|  return true;
  131|    191|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    145|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    139|    DecoderBuffer* buffer) {
  136|    139|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    139|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    139|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    139|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 139]
  ------------------
  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|    139|#endif
  146|    139|  {
  147|    139|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 136]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    139|  }
  151|    136|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 53, False: 83]
  ------------------
  152|     53|    return false;
  153|     53|  }
  154|     83|  const uint8_t* const data_head =
  155|     83|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     83|  buffer->Advance(bytes_encoded);
  158|     83|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 39, False: 44]
  ------------------
  159|     39|    return false;
  160|     39|  }
  161|     44|  return true;
  162|     83|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  32.7k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     44|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     44|  ans_.read_end();
  167|     44|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    321|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    321|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    321|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 321]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    321|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    321|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    321|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 321]
  ------------------
   67|      0|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 0]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      0|  } else
   72|    321|#endif
   73|    321|  {
   74|    321|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 311]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    321|  }
   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|    311|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 302]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    302|  probability_table_.resize(num_symbols_);
   86|    302|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 292]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  76.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 76.4k, False: 203]
  ------------------
   91|  76.4k|    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|  76.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 45, False: 76.4k]
  ------------------
   95|     45|      return false;
   96|     45|    }
   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|  76.4k|    const int token = prob_data & 3;
  102|  76.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 34.6k, False: 41.7k]
  ------------------
  103|  34.6k|      const uint32_t offset = prob_data >> 2;
  104|  34.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 34.6k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   737k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 702k, False: 34.6k]
  ------------------
  109|   702k|        probability_table_[i + j] = 0;
  110|   702k|      }
  111|  34.6k|      i += offset;
  112|  41.7k|    } else {
  113|  41.7k|      const int extra_bytes = token;
  114|  41.7k|      uint32_t prob = prob_data >> 2;
  115|  87.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 45.6k, False: 41.7k]
  ------------------
  116|  45.6k|        uint8_t eb;
  117|  45.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 45.5k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  45.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  45.5k|      }
  124|  41.7k|      probability_table_[i] = prob;
  125|  41.7k|    }
  126|  76.4k|  }
  127|    203|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 57, False: 146]
  ------------------
  128|     57|    return false;
  129|     57|  }
  130|    146|  return true;
  131|    203|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    156|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    146|    DecoderBuffer* buffer) {
  136|    146|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    146|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    146|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    146|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 146]
  ------------------
  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|    146|#endif
  146|    146|  {
  147|    146|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 143]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    146|  }
  151|    143|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 42, False: 101]
  ------------------
  152|     42|    return false;
  153|     42|  }
  154|    101|  const uint8_t* const data_head =
  155|    101|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    101|  buffer->Advance(bytes_encoded);
  158|    101|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 32, False: 69]
  ------------------
  159|     32|    return false;
  160|     32|  }
  161|     69|  return true;
  162|    101|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   302k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     69|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     69|  ans_.read_end();
  167|     69|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    362|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    362|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    362|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 362]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    362|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    362|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    362|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 340]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 22]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     22|  } else
   72|    340|#endif
   73|    340|  {
   74|    340|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 339]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    340|  }
   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|    361|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 354]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    354|  probability_table_.resize(num_symbols_);
   86|    354|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 343]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  78.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 78.6k, False: 245]
  ------------------
   91|  78.6k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  78.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 39, False: 78.6k]
  ------------------
   95|     39|      return false;
   96|     39|    }
   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|  78.6k|    const int token = prob_data & 3;
  102|  78.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 36.1k, False: 42.4k]
  ------------------
  103|  36.1k|      const uint32_t offset = prob_data >> 2;
  104|  36.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 38, False: 36.1k]
  ------------------
  105|     38|        return false;
  106|     38|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.77M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.73M, False: 36.1k]
  ------------------
  109|  1.73M|        probability_table_[i + j] = 0;
  110|  1.73M|      }
  111|  36.1k|      i += offset;
  112|  42.4k|    } else {
  113|  42.4k|      const int extra_bytes = token;
  114|  42.4k|      uint32_t prob = prob_data >> 2;
  115|  77.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 34.5k, False: 42.4k]
  ------------------
  116|  34.5k|        uint8_t eb;
  117|  34.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 34.5k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  34.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  34.5k|      }
  124|  42.4k|      probability_table_[i] = prob;
  125|  42.4k|    }
  126|  78.6k|  }
  127|    245|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 75, False: 170]
  ------------------
  128|     75|    return false;
  129|     75|  }
  130|    170|  return true;
  131|    245|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    181|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    170|    DecoderBuffer* buffer) {
  136|    170|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    170|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    170|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    170|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 170]
  ------------------
  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|    170|#endif
  146|    170|  {
  147|    170|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 8, False: 162]
  ------------------
  148|      8|      return false;
  149|      8|    }
  150|    170|  }
  151|    162|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 65, False: 97]
  ------------------
  152|     65|    return false;
  153|     65|  }
  154|     97|  const uint8_t* const data_head =
  155|     97|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     97|  buffer->Advance(bytes_encoded);
  158|     97|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 59]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|     59|  return true;
  162|     97|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   491k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     59|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     59|  ans_.read_end();
  167|     59|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    375|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    375|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    375|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 375]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    375|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    375|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    375|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 16, False: 359]
  ------------------
   67|     16|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 16]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     16|  } else
   72|    359|#endif
   73|    359|  {
   74|    359|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 354]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    359|  }
   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|    370|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 37, False: 333]
  ------------------
   83|     37|    return false;
   84|     37|  }
   85|    333|  probability_table_.resize(num_symbols_);
   86|    333|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 320]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|   246k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 245k, False: 224]
  ------------------
   91|   245k|    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|   245k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 50, False: 245k]
  ------------------
   95|     50|      return false;
   96|     50|    }
   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|   245k|    const int token = prob_data & 3;
  102|   245k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 116k, False: 129k]
  ------------------
  103|   116k|      const uint32_t offset = prob_data >> 2;
  104|   116k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 116k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.14M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.02M, False: 116k]
  ------------------
  109|  4.02M|        probability_table_[i + j] = 0;
  110|  4.02M|      }
  111|   116k|      i += offset;
  112|   129k|    } else {
  113|   129k|      const int extra_bytes = token;
  114|   129k|      uint32_t prob = prob_data >> 2;
  115|   211k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 82.0k, False: 129k]
  ------------------
  116|  82.0k|        uint8_t eb;
  117|  82.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 81.9k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  81.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  81.9k|      }
  124|   129k|      probability_table_[i] = prob;
  125|   129k|    }
  126|   245k|  }
  127|    224|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 35, False: 189]
  ------------------
  128|     35|    return false;
  129|     35|  }
  130|    189|  return true;
  131|    224|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    202|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    189|    DecoderBuffer* buffer) {
  136|    189|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    189|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    189|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    189|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 187]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      2|  } else
  145|    187|#endif
  146|    187|  {
  147|    187|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 183]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    187|  }
  151|    185|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 73, False: 112]
  ------------------
  152|     73|    return false;
  153|     73|  }
  154|    112|  const uint8_t* const data_head =
  155|    112|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    112|  buffer->Advance(bytes_encoded);
  158|    112|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 31, False: 81]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|     81|  return true;
  162|    112|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  22.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     81|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     81|  ans_.read_end();
  167|     81|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    287|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    287|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    287|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 287]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    287|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    287|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    287|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 18, False: 269]
  ------------------
   67|     18|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 18]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     18|  } else
   72|    269|#endif
   73|    269|  {
   74|    269|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 269]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    269|  }
   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|    287|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 280]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    280|  probability_table_.resize(num_symbols_);
   86|    280|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 280]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   269k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 269k, False: 179]
  ------------------
   91|   269k|    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|   269k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 55, False: 269k]
  ------------------
   95|     55|      return false;
   96|     55|    }
   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|   269k|    const int token = prob_data & 3;
  102|   269k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 58.3k, False: 211k]
  ------------------
  103|  58.3k|      const uint32_t offset = prob_data >> 2;
  104|  58.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 58.2k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.20M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.14M, False: 58.2k]
  ------------------
  109|  2.14M|        probability_table_[i + j] = 0;
  110|  2.14M|      }
  111|  58.2k|      i += offset;
  112|   211k|    } else {
  113|   211k|      const int extra_bytes = token;
  114|   211k|      uint32_t prob = prob_data >> 2;
  115|   290k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 79.1k, False: 211k]
  ------------------
  116|  79.1k|        uint8_t eb;
  117|  79.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 79.1k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  79.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  79.1k|      }
  124|   211k|      probability_table_[i] = prob;
  125|   211k|    }
  126|   269k|  }
  127|    179|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 17, False: 162]
  ------------------
  128|     17|    return false;
  129|     17|  }
  130|    162|  return true;
  131|    179|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    162|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    162|    DecoderBuffer* buffer) {
  136|    162|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    162|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    162|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    162|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 14, False: 148]
  ------------------
  140|     14|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 14]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     14|  } else
  145|    148|#endif
  146|    148|  {
  147|    148|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 141]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    148|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 36, False: 119]
  ------------------
  152|     36|    return false;
  153|     36|  }
  154|    119|  const uint8_t* const data_head =
  155|    119|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    119|  buffer->Advance(bytes_encoded);
  158|    119|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 42, False: 77]
  ------------------
  159|     42|    return false;
  160|     42|  }
  161|     77|  return true;
  162|    119|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  10.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     77|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     77|  ans_.read_end();
  167|     77|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    295|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    295|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    295|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 295]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    295|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    295|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    295|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 280]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 15]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     15|  } else
   72|    280|#endif
   73|    280|  {
   74|    280|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 267]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    280|  }
   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|    282|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 266]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    266|  probability_table_.resize(num_symbols_);
   86|    266|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 264]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  27.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 27.4k, False: 197]
  ------------------
   91|  27.4k|    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|  27.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 37, False: 27.3k]
  ------------------
   95|     37|      return false;
   96|     37|    }
   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|  27.3k|    const int token = prob_data & 3;
  102|  27.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 19.7k, False: 7.62k]
  ------------------
  103|  19.7k|      const uint32_t offset = prob_data >> 2;
  104|  19.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 20, False: 19.7k]
  ------------------
  105|     20|        return false;
  106|     20|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.16M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.14M, False: 19.7k]
  ------------------
  109|  1.14M|        probability_table_[i + j] = 0;
  110|  1.14M|      }
  111|  19.7k|      i += offset;
  112|  19.7k|    } else {
  113|  7.62k|      const int extra_bytes = token;
  114|  7.62k|      uint32_t prob = prob_data >> 2;
  115|  12.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.17k, False: 7.61k]
  ------------------
  116|  5.17k|        uint8_t eb;
  117|  5.17k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 5.16k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.16k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.16k|      }
  124|  7.61k|      probability_table_[i] = prob;
  125|  7.61k|    }
  126|  27.3k|  }
  127|    197|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 28, False: 169]
  ------------------
  128|     28|    return false;
  129|     28|  }
  130|    169|  return true;
  131|    197|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    171|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    169|    DecoderBuffer* buffer) {
  136|    169|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    169|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    169|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    169|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 162]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 7]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      7|  } else
  145|    162|#endif
  146|    162|  {
  147|    162|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 14, False: 148]
  ------------------
  148|     14|      return false;
  149|     14|    }
  150|    162|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 50, False: 105]
  ------------------
  152|     50|    return false;
  153|     50|  }
  154|    105|  const uint8_t* const data_head =
  155|    105|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    105|  buffer->Advance(bytes_encoded);
  158|    105|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 29, False: 76]
  ------------------
  159|     29|    return false;
  160|     29|  }
  161|     76|  return true;
  162|    105|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  25.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     76|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     76|  ans_.read_end();
  167|     76|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    297|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    297|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    297|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 297]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    297|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    297|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    297|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 271]
  ------------------
   67|     26|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 26]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     26|  } else
   72|    271|#endif
   73|    271|  {
   74|    271|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 269]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    271|  }
   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|    295|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 283]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    283|  probability_table_.resize(num_symbols_);
   86|    283|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 273]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   793k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 793k, False: 174]
  ------------------
   91|   793k|    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|   793k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 44, False: 793k]
  ------------------
   95|     44|      return false;
   96|     44|    }
   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|   793k|    const int token = prob_data & 3;
  102|   793k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 311k, False: 481k]
  ------------------
  103|   311k|      const uint32_t offset = prob_data >> 2;
  104|   311k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 311k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.56M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.25M, False: 311k]
  ------------------
  109|  7.25M|        probability_table_[i + j] = 0;
  110|  7.25M|      }
  111|   311k|      i += offset;
  112|   481k|    } else {
  113|   481k|      const int extra_bytes = token;
  114|   481k|      uint32_t prob = prob_data >> 2;
  115|   961k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 479k, False: 481k]
  ------------------
  116|   479k|        uint8_t eb;
  117|   479k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 479k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   479k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   479k|      }
  124|   481k|      probability_table_[i] = prob;
  125|   481k|    }
  126|   793k|  }
  127|    174|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 148]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    148|  return true;
  131|    174|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    158|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    148|    DecoderBuffer* buffer) {
  136|    148|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    148|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 18, False: 130]
  ------------------
  140|     18|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 18]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     18|  } else
  145|    130|#endif
  146|    130|  {
  147|    130|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 130]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    130|  }
  151|    148|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 63, False: 85]
  ------------------
  152|     63|    return false;
  153|     63|  }
  154|     85|  const uint8_t* const data_head =
  155|     85|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     85|  buffer->Advance(bytes_encoded);
  158|     85|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 18, False: 67]
  ------------------
  159|     18|    return false;
  160|     18|  }
  161|     67|  return true;
  162|     85|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  23.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     67|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     67|  ans_.read_end();
  167|     67|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    274|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    274|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    274|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 274]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    274|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    274|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    274|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 67, False: 207]
  ------------------
   67|     67|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 67]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     67|  } else
   72|    207|#endif
   73|    207|  {
   74|    207|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 196]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    207|  }
   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|    263|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 249]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    249|  probability_table_.resize(num_symbols_);
   86|    249|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 249]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  7.25k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.07k, False: 179]
  ------------------
   91|  7.07k|    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.07k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 7.04k]
  ------------------
   95|     23|      return false;
   96|     23|    }
   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.04k|    const int token = prob_data & 3;
  102|  7.04k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.60k, False: 3.44k]
  ------------------
  103|  3.60k|      const uint32_t offset = prob_data >> 2;
  104|  3.60k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 3.57k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   133k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 129k, False: 3.57k]
  ------------------
  109|   129k|        probability_table_[i + j] = 0;
  110|   129k|      }
  111|  3.57k|      i += offset;
  112|  3.57k|    } else {
  113|  3.44k|      const int extra_bytes = token;
  114|  3.44k|      uint32_t prob = prob_data >> 2;
  115|  5.99k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.57k, False: 3.42k]
  ------------------
  116|  2.57k|        uint8_t eb;
  117|  2.57k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 2.55k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.55k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.55k|      }
  124|  3.42k|      probability_table_[i] = prob;
  125|  3.42k|    }
  126|  7.04k|  }
  127|    179|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 159]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    159|  return true;
  131|    179|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    159|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    159|    DecoderBuffer* buffer) {
  136|    159|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    159|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    159|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    159|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 63, False: 96]
  ------------------
  140|     63|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 63]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     63|  } else
  145|     96|#endif
  146|     96|  {
  147|     96|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 93]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     96|  }
  151|    156|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 78, False: 78]
  ------------------
  152|     78|    return false;
  153|     78|  }
  154|     78|  const uint8_t* const data_head =
  155|     78|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     78|  buffer->Advance(bytes_encoded);
  158|     78|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 2, False: 76]
  ------------------
  159|      2|    return false;
  160|      2|  }
  161|     76|  return true;
  162|     78|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  61.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     76|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     76|  ans_.read_end();
  167|     76|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  10.1k|                   DecoderBuffer* src_buffer, uint32_t* out_values) {
   34|  10.1k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 5, False: 10.1k]
  ------------------
   35|      5|    return true;
   36|      5|  }
   37|       |  // Decode which scheme to use.
   38|  10.1k|  uint8_t scheme;
   39|  10.1k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 160, False: 9.99k]
  ------------------
   40|    160|    return false;
   41|    160|  }
   42|  9.99k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.12k, False: 8.86k]
  ------------------
   43|  1.12k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.12k|                                                  src_buffer, out_values);
   45|  8.86k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 6.14k, False: 2.71k]
  ------------------
   46|  6.14k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  6.14k|                                               out_values);
   48|  6.14k|  }
   49|  2.71k|  return false;
   50|  9.99k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.12k|                         DecoderBuffer* src_buffer, uint32_t* out_values) {
   55|       |  // Decode the encoded data.
   56|  1.12k|  SymbolDecoderT<5> tag_decoder;
   57|  1.12k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 519, False: 609]
  ------------------
   58|    519|    return false;
   59|    519|  }
   60|       |
   61|    609|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 259, False: 350]
  ------------------
   62|    259|    return false;
   63|    259|  }
   64|       |
   65|    350|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 350, False: 0]
  |  Branch (65:25): [True: 68, False: 282]
  ------------------
   66|     68|    return false;  // Wrong number of symbols.
   67|     68|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    282|  src_buffer->StartBitDecoding(false, nullptr);
   72|    282|  int value_id = 0;
   73|  1.26M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 1.26M, False: 279]
  ------------------
   74|       |    // Decode the tag.
   75|  1.26M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  2.90M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 1.63M, False: 1.26M]
  ------------------
   78|  1.63M|      uint32_t val;
   79|  1.63M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 3, False: 1.63M]
  ------------------
   80|      3|        return false;
   81|      3|      }
   82|  1.63M|      out_values[value_id++] = val;
   83|  1.63M|    }
   84|  1.26M|  }
   85|    279|  tag_decoder.EndDecoding();
   86|    279|  src_buffer->EndBitDecoding();
   87|    279|  return true;
   88|    282|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  6.14k|                      uint32_t* out_values) {
  117|  6.14k|  uint8_t max_bit_length;
  118|  6.14k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 14, False: 6.13k]
  ------------------
  119|     14|    return false;
  120|     14|  }
  121|  6.13k|  switch (max_bit_length) {
  122|    651|    case 1:
  ------------------
  |  Branch (122:5): [True: 651, False: 5.48k]
  ------------------
  123|    651|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    651|                                                         out_values);
  125|    397|    case 2:
  ------------------
  |  Branch (125:5): [True: 397, False: 5.73k]
  ------------------
  126|    397|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    397|                                                         out_values);
  128|    278|    case 3:
  ------------------
  |  Branch (128:5): [True: 278, False: 5.85k]
  ------------------
  129|    278|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    278|                                                         out_values);
  131|    309|    case 4:
  ------------------
  |  Branch (131:5): [True: 309, False: 5.82k]
  ------------------
  132|    309|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    309|                                                         out_values);
  134|    277|    case 5:
  ------------------
  |  Branch (134:5): [True: 277, False: 5.85k]
  ------------------
  135|    277|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    277|                                                         out_values);
  137|    408|    case 6:
  ------------------
  |  Branch (137:5): [True: 408, False: 5.72k]
  ------------------
  138|    408|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    408|                                                         out_values);
  140|    318|    case 7:
  ------------------
  |  Branch (140:5): [True: 318, False: 5.81k]
  ------------------
  141|    318|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    318|                                                         out_values);
  143|    211|    case 8:
  ------------------
  |  Branch (143:5): [True: 211, False: 5.92k]
  ------------------
  144|    211|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    211|                                                         out_values);
  146|    197|    case 9:
  ------------------
  |  Branch (146:5): [True: 197, False: 5.93k]
  ------------------
  147|    197|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    197|                                                         out_values);
  149|    274|    case 10:
  ------------------
  |  Branch (149:5): [True: 274, False: 5.86k]
  ------------------
  150|    274|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    274|          num_values, src_buffer, out_values);
  152|    309|    case 11:
  ------------------
  |  Branch (152:5): [True: 309, False: 5.82k]
  ------------------
  153|    309|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    309|          num_values, src_buffer, out_values);
  155|    321|    case 12:
  ------------------
  |  Branch (155:5): [True: 321, False: 5.81k]
  ------------------
  156|    321|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    321|          num_values, src_buffer, out_values);
  158|    362|    case 13:
  ------------------
  |  Branch (158:5): [True: 362, False: 5.77k]
  ------------------
  159|    362|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    362|          num_values, src_buffer, out_values);
  161|    375|    case 14:
  ------------------
  |  Branch (161:5): [True: 375, False: 5.76k]
  ------------------
  162|    375|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    375|          num_values, src_buffer, out_values);
  164|    287|    case 15:
  ------------------
  |  Branch (164:5): [True: 287, False: 5.84k]
  ------------------
  165|    287|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    287|          num_values, src_buffer, out_values);
  167|    295|    case 16:
  ------------------
  |  Branch (167:5): [True: 295, False: 5.84k]
  ------------------
  168|    295|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    295|          num_values, src_buffer, out_values);
  170|    297|    case 17:
  ------------------
  |  Branch (170:5): [True: 297, False: 5.83k]
  ------------------
  171|    297|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    297|          num_values, src_buffer, out_values);
  173|    274|    case 18:
  ------------------
  |  Branch (173:5): [True: 274, False: 5.86k]
  ------------------
  174|    274|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    274|          num_values, src_buffer, out_values);
  176|    295|    default:
  ------------------
  |  Branch (176:5): [True: 295, False: 5.84k]
  ------------------
  177|    295|      return false;
  178|  6.13k|  }
  179|  6.13k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    651|                              uint32_t* out_values) {
   93|    651|  SymbolDecoderT decoder;
   94|    651|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 360, False: 291]
  ------------------
   95|    360|    return false;
   96|    360|  }
   97|       |
   98|    291|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 291, False: 0]
  |  Branch (98:25): [True: 17, False: 274]
  ------------------
   99|     17|    return false;  // Wrong number of symbols.
  100|     17|  }
  101|       |
  102|    274|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 33, False: 241]
  ------------------
  103|     33|    return false;
  104|     33|  }
  105|  70.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 70.9M, False: 241]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  70.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  70.9M|    out_values[i] = value;
  109|  70.9M|  }
  110|    241|  decoder.EndDecoding();
  111|    241|  return true;
  112|    274|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    397|                              uint32_t* out_values) {
   93|    397|  SymbolDecoderT decoder;
   94|    397|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 121, False: 276]
  ------------------
   95|    121|    return false;
   96|    121|  }
   97|       |
   98|    276|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 276, False: 0]
  |  Branch (98:25): [True: 7, False: 269]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    269|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 47, False: 222]
  ------------------
  103|     47|    return false;
  104|     47|  }
  105|  5.09M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.09M, False: 222]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.09M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.09M|    out_values[i] = value;
  109|  5.09M|  }
  110|    222|  decoder.EndDecoding();
  111|    222|  return true;
  112|    269|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    278|                              uint32_t* out_values) {
   93|    278|  SymbolDecoderT decoder;
   94|    278|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 108, False: 170]
  ------------------
   95|    108|    return false;
   96|    108|  }
   97|       |
   98|    170|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 170, False: 0]
  |  Branch (98:25): [True: 5, False: 165]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    165|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 78, False: 87]
  ------------------
  103|     78|    return false;
  104|     78|  }
  105|  15.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 15.9M, False: 87]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  15.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  15.9M|    out_values[i] = value;
  109|  15.9M|  }
  110|     87|  decoder.EndDecoding();
  111|     87|  return true;
  112|    165|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    309|                              uint32_t* out_values) {
   93|    309|  SymbolDecoderT decoder;
   94|    309|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 109, False: 200]
  ------------------
   95|    109|    return false;
   96|    109|  }
   97|       |
   98|    200|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 200, False: 0]
  |  Branch (98:25): [True: 11, False: 189]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    189|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 51, False: 138]
  ------------------
  103|     51|    return false;
  104|     51|  }
  105|  3.06M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.06M, False: 138]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.06M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.06M|    out_values[i] = value;
  109|  3.06M|  }
  110|    138|  decoder.EndDecoding();
  111|    138|  return true;
  112|    189|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    277|                              uint32_t* out_values) {
   93|    277|  SymbolDecoderT decoder;
   94|    277|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 24, False: 253]
  ------------------
   95|     24|    return false;
   96|     24|  }
   97|       |
   98|    253|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 253, False: 0]
  |  Branch (98:25): [True: 158, False: 95]
  ------------------
   99|    158|    return false;  // Wrong number of symbols.
  100|    158|  }
  101|       |
  102|     95|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 15, False: 80]
  ------------------
  103|     15|    return false;
  104|     15|  }
  105|  3.48M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.48M, False: 80]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.48M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.48M|    out_values[i] = value;
  109|  3.48M|  }
  110|     80|  decoder.EndDecoding();
  111|     80|  return true;
  112|     95|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    408|                              uint32_t* out_values) {
   93|    408|  SymbolDecoderT decoder;
   94|    408|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 96, False: 312]
  ------------------
   95|     96|    return false;
   96|     96|  }
   97|       |
   98|    312|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 312, False: 0]
  |  Branch (98:25): [True: 2, False: 310]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    310|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 60, False: 250]
  ------------------
  103|     60|    return false;
  104|     60|  }
  105|  10.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.4M, False: 250]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.4M|    out_values[i] = value;
  109|  10.4M|  }
  110|    250|  decoder.EndDecoding();
  111|    250|  return true;
  112|    310|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    318|                              uint32_t* out_values) {
   93|    318|  SymbolDecoderT decoder;
   94|    318|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 123, False: 195]
  ------------------
   95|    123|    return false;
   96|    123|  }
   97|       |
   98|    195|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 195, False: 0]
  |  Branch (98:25): [True: 2, False: 193]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    193|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 66, False: 127]
  ------------------
  103|     66|    return false;
  104|     66|  }
  105|  11.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.8M, False: 127]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.8M|    out_values[i] = value;
  109|  11.8M|  }
  110|    127|  decoder.EndDecoding();
  111|    127|  return true;
  112|    193|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    211|                              uint32_t* out_values) {
   93|    211|  SymbolDecoderT decoder;
   94|    211|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 108, False: 103]
  ------------------
   95|    108|    return false;
   96|    108|  }
   97|       |
   98|    103|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 103, False: 0]
  |  Branch (98:25): [True: 0, False: 103]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    103|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 27, False: 76]
  ------------------
  103|     27|    return false;
  104|     27|  }
  105|   572k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 572k, False: 76]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   572k|    const uint32_t value = decoder.DecodeSymbol();
  108|   572k|    out_values[i] = value;
  109|   572k|  }
  110|     76|  decoder.EndDecoding();
  111|     76|  return true;
  112|    103|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    197|                              uint32_t* out_values) {
   93|    197|  SymbolDecoderT decoder;
   94|    197|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 111, False: 86]
  ------------------
   95|    111|    return false;
   96|    111|  }
   97|       |
   98|     86|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 86, False: 0]
  |  Branch (98:25): [True: 2, False: 84]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|     84|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 35, False: 49]
  ------------------
  103|     35|    return false;
  104|     35|  }
  105|   161k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 161k, False: 49]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   161k|    const uint32_t value = decoder.DecodeSymbol();
  108|   161k|    out_values[i] = value;
  109|   161k|  }
  110|     49|  decoder.EndDecoding();
  111|     49|  return true;
  112|     84|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    274|                              uint32_t* out_values) {
   93|    274|  SymbolDecoderT decoder;
   94|    274|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 136, False: 138]
  ------------------
   95|    136|    return false;
   96|    136|  }
   97|       |
   98|    138|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 138, False: 0]
  |  Branch (98:25): [True: 5, False: 133]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    133|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 52, False: 81]
  ------------------
  103|     52|    return false;
  104|     52|  }
  105|   548k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 548k, False: 81]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   548k|    const uint32_t value = decoder.DecodeSymbol();
  108|   548k|    out_values[i] = value;
  109|   548k|  }
  110|     81|  decoder.EndDecoding();
  111|     81|  return true;
  112|    133|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    309|                              uint32_t* out_values) {
   93|    309|  SymbolDecoderT decoder;
   94|    309|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 164, False: 145]
  ------------------
   95|    164|    return false;
   96|    164|  }
   97|       |
   98|    145|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 145, False: 0]
  |  Branch (98:25): [True: 6, False: 139]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    139|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 95, False: 44]
  ------------------
  103|     95|    return false;
  104|     95|  }
  105|  32.7k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 32.7k, False: 44]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  32.7k|    const uint32_t value = decoder.DecodeSymbol();
  108|  32.7k|    out_values[i] = value;
  109|  32.7k|  }
  110|     44|  decoder.EndDecoding();
  111|     44|  return true;
  112|    139|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    321|                              uint32_t* out_values) {
   93|    321|  SymbolDecoderT decoder;
   94|    321|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 165, False: 156]
  ------------------
   95|    165|    return false;
   96|    165|  }
   97|       |
   98|    156|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 156, False: 0]
  |  Branch (98:25): [True: 10, False: 146]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    146|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 77, False: 69]
  ------------------
  103|     77|    return false;
  104|     77|  }
  105|   302k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 302k, False: 69]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   302k|    const uint32_t value = decoder.DecodeSymbol();
  108|   302k|    out_values[i] = value;
  109|   302k|  }
  110|     69|  decoder.EndDecoding();
  111|     69|  return true;
  112|    146|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    362|                              uint32_t* out_values) {
   93|    362|  SymbolDecoderT decoder;
   94|    362|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 181, False: 181]
  ------------------
   95|    181|    return false;
   96|    181|  }
   97|       |
   98|    181|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 181, False: 0]
  |  Branch (98:25): [True: 11, False: 170]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    170|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 111, False: 59]
  ------------------
  103|    111|    return false;
  104|    111|  }
  105|   491k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 491k, False: 59]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   491k|    const uint32_t value = decoder.DecodeSymbol();
  108|   491k|    out_values[i] = value;
  109|   491k|  }
  110|     59|  decoder.EndDecoding();
  111|     59|  return true;
  112|    170|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    375|                              uint32_t* out_values) {
   93|    375|  SymbolDecoderT decoder;
   94|    375|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 173, False: 202]
  ------------------
   95|    173|    return false;
   96|    173|  }
   97|       |
   98|    202|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 202, False: 0]
  |  Branch (98:25): [True: 13, False: 189]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    189|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 108, False: 81]
  ------------------
  103|    108|    return false;
  104|    108|  }
  105|  22.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 22.5M, False: 81]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  22.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  22.5M|    out_values[i] = value;
  109|  22.5M|  }
  110|     81|  decoder.EndDecoding();
  111|     81|  return true;
  112|    189|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    287|                              uint32_t* out_values) {
   93|    287|  SymbolDecoderT decoder;
   94|    287|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 125, False: 162]
  ------------------
   95|    125|    return false;
   96|    125|  }
   97|       |
   98|    162|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 162, False: 0]
  |  Branch (98:25): [True: 0, False: 162]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    162|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 85, False: 77]
  ------------------
  103|     85|    return false;
  104|     85|  }
  105|  10.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.7M, False: 77]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.7M|    out_values[i] = value;
  109|  10.7M|  }
  110|     77|  decoder.EndDecoding();
  111|     77|  return true;
  112|    162|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    295|                              uint32_t* out_values) {
   93|    295|  SymbolDecoderT decoder;
   94|    295|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 124, False: 171]
  ------------------
   95|    124|    return false;
   96|    124|  }
   97|       |
   98|    171|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 171, False: 0]
  |  Branch (98:25): [True: 2, False: 169]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    169|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 93, False: 76]
  ------------------
  103|     93|    return false;
  104|     93|  }
  105|  25.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 25.9M, False: 76]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  25.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  25.9M|    out_values[i] = value;
  109|  25.9M|  }
  110|     76|  decoder.EndDecoding();
  111|     76|  return true;
  112|    169|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    297|                              uint32_t* out_values) {
   93|    297|  SymbolDecoderT decoder;
   94|    297|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 139, False: 158]
  ------------------
   95|    139|    return false;
   96|    139|  }
   97|       |
   98|    158|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 158, False: 0]
  |  Branch (98:25): [True: 10, False: 148]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    148|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 81, False: 67]
  ------------------
  103|     81|    return false;
  104|     81|  }
  105|  23.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 23.7M, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  23.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  23.7M|    out_values[i] = value;
  109|  23.7M|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|    148|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    274|                              uint32_t* out_values) {
   93|    274|  SymbolDecoderT decoder;
   94|    274|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 115, False: 159]
  ------------------
   95|    115|    return false;
   96|    115|  }
   97|       |
   98|    159|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 159, False: 0]
  |  Branch (98:25): [True: 0, False: 159]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    159|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 83, False: 76]
  ------------------
  103|     83|    return false;
  104|     83|  }
  105|  61.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 61.5M, False: 76]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  61.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  61.5M|    out_values[i] = value;
  109|  61.5M|  }
  110|     76|  decoder.EndDecoding();
  111|     76|  return true;
  112|    159|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  2.76k|    : decoder_(nullptr),
   49|  2.76k|      last_symbol_id_(-1),
   50|  2.76k|      last_vert_id_(-1),
   51|  2.76k|      last_face_id_(-1),
   52|  2.76k|      num_new_vertices_(0),
   53|  2.76k|      num_encoded_vertices_(0),
   54|  2.76k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.76k|    MeshEdgebreakerDecoder* decoder) {
   59|  2.76k|  decoder_ = decoder;
   60|  2.76k|  return true;
   61|  2.76k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  3.07k|    int att_id) const {
   67|  4.96k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 4.19k, False: 771]
  ------------------
   68|  4.19k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  4.19k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.89k, False: 2.30k]
  |  Branch (69:27): [True: 0, False: 2.30k]
  ------------------
   70|  1.89k|      continue;
   71|  1.89k|    }
   72|  2.30k|    const AttributesDecoderInterface* const dec =
   73|  2.30k|        decoder_->attributes_decoder(decoder_id);
   74|  6.54k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 6.54k, False: 0]
  ------------------
   75|  6.54k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 2.30k, False: 4.24k]
  ------------------
   76|  2.30k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.46k, False: 840]
  ------------------
   77|  1.46k|          return &attribute_data_[i].connectivity_data;
   78|  1.46k|        }
   79|    840|        return nullptr;
   80|  2.30k|      }
   81|  6.54k|    }
   82|  2.30k|  }
   83|    771|  return nullptr;
   84|  3.07k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  3.07k|    int att_id) const {
   90|  4.96k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 4.19k, False: 771]
  ------------------
   91|  4.19k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  4.19k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.89k, False: 2.30k]
  |  Branch (92:27): [True: 0, False: 2.30k]
  ------------------
   93|  1.89k|      continue;
   94|  1.89k|    }
   95|  2.30k|    const AttributesDecoderInterface* const dec =
   96|  2.30k|        decoder_->attributes_decoder(decoder_id);
   97|  6.54k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 6.54k, False: 0]
  ------------------
   98|  6.54k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 2.30k, False: 4.24k]
  ------------------
   99|  2.30k|        return &attribute_data_[i].encoding_data;
  100|  2.30k|      }
  101|  6.54k|    }
  102|  2.30k|  }
  103|    771|  return &pos_encoding_data_;
  104|  3.07k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  2.25k|    int32_t att_decoder_id) {
  131|  2.25k|  int8_t att_data_id;
  132|  2.25k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 6, False: 2.24k]
  ------------------
  133|      6|    return false;
  134|      6|  }
  135|  2.24k|  uint8_t decoder_type;
  136|  2.24k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 4, False: 2.24k]
  ------------------
  137|      4|    return false;
  138|      4|  }
  139|       |
  140|  2.24k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.68k, False: 559]
  ------------------
  141|  1.68k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 60, False: 1.62k]
  ------------------
  142|     60|      return false;  // Unexpected attribute data.
  143|     60|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.62k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 7, False: 1.61k]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|       |
  151|  1.61k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.61k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    559|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 558]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    558|    pos_data_decoder_id_ = att_decoder_id;
  158|    558|  }
  159|       |
  160|  2.17k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  2.17k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  2.17k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 2.17k, False: 1]
  ------------------
  162|  2.17k|    uint8_t traversal_method_encoded;
  163|  2.17k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 4, False: 2.17k]
  ------------------
  164|      4|      return false;
  165|      4|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  2.17k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 28, False: 2.14k]
  ------------------
  168|     28|      return false;
  169|     28|    }
  170|  2.14k|    traversal_method =
  171|  2.14k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  2.14k|  }
  173|       |
  174|  2.14k|  const Mesh* mesh = decoder_->mesh();
  175|  2.14k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  2.14k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1.09k, False: 1.05k]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|  1.09k|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|  1.09k|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 537, False: 556]
  ------------------
  182|    537|      encoding_data = &pos_encoding_data_;
  183|    556|    } else {
  184|    556|      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|    556|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    556|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|  1.09k|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 150, False: 943]
  ------------------
  191|    150|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    150|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    150|          AttTraverser;
  194|    150|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    943|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 943, False: 0]
  ------------------
  196|    943|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    943|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    943|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    943|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|  1.09k|  } else {
  203|  1.05k|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 6, False: 1.04k]
  ------------------
  204|      6|      return false;  // Unsupported method.
  205|      6|    }
  206|  1.04k|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 4, False: 1.04k]
  ------------------
  207|      4|      return false;  // Attribute data must be specified.
  208|      4|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|  1.04k|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|  1.04k|        AttObserver;
  214|  1.04k|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|  1.04k|        AttTraverser;
  216|       |
  217|  1.04k|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|  1.04k|        &attribute_data_[att_data_id].encoding_data;
  219|  1.04k|    const MeshAttributeCornerTable* const corner_table =
  220|  1.04k|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|  1.04k|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|  1.04k|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|  1.04k|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|  1.04k|                             encoding_data);
  227|       |
  228|  1.04k|    AttTraverser att_traverser;
  229|  1.04k|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|  1.04k|    traversal_sequencer->SetTraverser(att_traverser);
  232|  1.04k|    sequencer = std::move(traversal_sequencer);
  233|  1.04k|  }
  234|       |
  235|  2.13k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 2.13k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  2.13k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  2.13k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  2.13k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  2.13k|                                        std::move(att_controller));
  244|  2.13k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  2.76k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.76k|  num_new_vertices_ = 0;
  249|  2.76k|  new_to_parent_vertex_map_.clear();
  250|  2.76k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.76k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 565, False: 2.20k]
  ------------------
  252|    565|    uint32_t num_new_verts;
  253|    565|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    565|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 163, False: 402]
  ------------------
  254|    163|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 163]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    402|    } else {
  258|    402|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 402]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    402|    }
  262|    565|    num_new_vertices_ = num_new_verts;
  263|    565|  }
  264|  2.76k|#endif
  265|       |
  266|  2.76k|  uint32_t num_encoded_vertices;
  267|  2.76k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.76k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 163, False: 2.60k]
  ------------------
  269|    163|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 163]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    163|  } else
  274|  2.60k|#endif
  275|  2.60k|  {
  276|  2.60k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 2.60k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  2.60k|  }
  280|  2.76k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.76k|  uint32_t num_faces;
  283|  2.76k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.76k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 163, False: 2.60k]
  ------------------
  285|    163|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 163]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    163|  } else
  290|  2.60k|#endif
  291|  2.60k|  {
  292|  2.60k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 2.60k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  2.60k|  }
  296|  2.76k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 0, False: 2.76k]
  ------------------
  297|      0|    return false;  // Draco cannot handle this many faces.
  298|      0|  }
  299|       |
  300|  2.76k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 0, False: 2.76k]
  ------------------
  301|      0|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      0|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.76k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  2.76k|  const uint64_t num_encoded_vertices_64 =
  311|  2.76k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.76k|  const uint64_t max_num_vertex_edges =
  313|  2.76k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.76k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 1, False: 2.76k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      1|    return false;
  317|      1|  }
  318|       |
  319|  2.76k|  uint8_t num_attribute_data;
  320|  2.76k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.76k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.76k|  uint32_t num_encoded_symbols;
  325|  2.76k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.76k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 162, False: 2.60k]
  ------------------
  327|    162|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 162]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    162|  } else
  332|  2.60k|#endif
  333|  2.60k|  {
  334|  2.60k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 2.60k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  2.60k|  }
  338|       |
  339|  2.76k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 5, False: 2.75k]
  ------------------
  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|      5|    return false;
  344|      5|  }
  345|  2.75k|  const uint32_t max_encoded_faces =
  346|  2.75k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.75k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 7, False: 2.75k]
  ------------------
  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|      7|    return false;
  352|      7|  }
  353|       |
  354|  2.75k|  uint32_t num_encoded_split_symbols;
  355|  2.75k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.75k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.75k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 153, False: 2.59k]
  ------------------
  357|    153|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 153]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    153|  } else
  362|  2.59k|#endif
  363|  2.59k|  {
  364|  2.59k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 2.59k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  2.59k|  }
  368|       |
  369|  2.75k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 10, False: 2.74k]
  ------------------
  370|     10|    return false;  // Split symbols are a sub-set of all symbols.
  371|     10|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.74k|  vertex_traversal_length_.clear();
  375|  2.74k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.74k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.74k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.74k|  processed_corner_ids_.clear();
  380|  2.74k|  processed_corner_ids_.reserve(num_faces);
  381|  2.74k|  processed_connectivity_corners_.clear();
  382|  2.74k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.74k|  topology_split_data_.clear();
  384|  2.74k|  hole_event_data_.clear();
  385|  2.74k|  init_face_configurations_.clear();
  386|  2.74k|  init_corners_.clear();
  387|       |
  388|  2.74k|  last_symbol_id_ = -1;
  389|  2.74k|  last_face_id_ = -1;
  390|  2.74k|  last_vert_id_ = -1;
  391|       |
  392|  2.74k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.74k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.74k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 2.74k]
  ------------------
  397|  2.74k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      1|    return false;
  399|      1|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  2.74k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.74k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.74k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.74k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.74k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 546, False: 2.19k]
  ------------------
  411|    546|    uint32_t encoded_connectivity_size;
  412|    546|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    546|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 150, False: 396]
  ------------------
  413|    150|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 150]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|    396|    } else {
  417|    396|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 396]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    396|    }
  421|    546|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 2, False: 544]
  ------------------
  422|    544|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 17, False: 527]
  ------------------
  423|     19|      return false;
  424|     19|    }
  425|    527|    DecoderBuffer event_buffer;
  426|    527|    event_buffer.Init(
  427|    527|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    527|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    527|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    527|    topology_split_decoded_bytes =
  432|    527|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    527|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 135, False: 392]
  ------------------
  434|    135|      return false;
  435|    135|    }
  436|       |
  437|    527|  } else
  438|  2.19k|#endif
  439|  2.19k|  {
  440|  2.19k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 15, False: 2.18k]
  ------------------
  441|     15|      return false;
  442|     15|    }
  443|  2.19k|  }
  444|       |
  445|  2.57k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.57k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.57k|                                           num_encoded_split_symbols);
  449|  2.57k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.57k|  DecoderBuffer traversal_end_buffer;
  452|  2.57k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 116, False: 2.45k]
  ------------------
  453|    116|    return false;
  454|    116|  }
  455|       |
  456|  2.45k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  2.45k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 203, False: 2.25k]
  ------------------
  458|    203|    return false;
  459|    203|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  2.25k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  2.25k|                           traversal_end_buffer.remaining_size(),
  464|  2.25k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  2.25k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  2.25k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.25k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 289, False: 1.96k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    289|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    289|  }
  471|  2.25k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  2.25k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 2.21k, False: 35]
  ------------------
  475|  2.21k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  2.21k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.21k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 283, False: 1.93k]
  ------------------
  477|  2.10k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.82k, False: 283]
  ------------------
  478|  1.82k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.82k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.82k|      }
  482|       |
  483|    283|    } else
  484|  1.93k|#endif
  485|  1.93k|    {
  486|   360k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 358k, False: 1.93k]
  ------------------
  487|   358k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 358k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   358k|      }
  491|  1.93k|    }
  492|  2.21k|  }
  493|  2.25k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  7.52k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 5.27k, False: 2.25k]
  ------------------
  498|  5.27k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  2.86M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 2.86M, False: 5.27k]
  ------------------
  501|  2.86M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  2.86M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  5.27k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 5.27k]
  ------------------
  505|  5.27k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  5.27k|  }
  509|       |
  510|  2.25k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  7.52k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 5.27k, False: 2.25k]
  ------------------
  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|  5.27k|    int32_t att_connectivity_verts =
  517|  5.27k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  5.27k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 417, False: 4.85k]
  ------------------
  519|    417|      att_connectivity_verts = corner_table_->num_vertices();
  520|    417|    }
  521|  5.27k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  5.27k|  }
  523|  2.25k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 9, False: 2.24k]
  ------------------
  524|      9|    return false;
  525|      9|  }
  526|  2.24k|  return true;
  527|  2.25k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    502|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    502|  return true;
  532|    502|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  2.45k|    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.45k|  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.45k|  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.45k|  std::vector<VertexIndex> invalid_vertices;
  558|  2.45k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  2.45k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  2.45k|  int num_faces = 0;
  562|  10.4M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 10.4M, False: 2.29k]
  ------------------
  563|  10.4M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  10.4M|    bool check_topology_split = false;
  566|  10.4M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  10.4M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 4.18M, False: 6.27M]
  ------------------
  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.18M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 4.18M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  4.18M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  4.18M|      const VertexIndex vertex_x =
  593|  4.18M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  4.18M|      const CornerIndex corner_b =
  595|  4.18M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  4.18M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 113, False: 4.18M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    113|        return -1;
  600|    113|      }
  601|  4.18M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 4.18M]
  |  Branch (601:11): [True: 0, False: 4.18M]
  ------------------
  602|  4.18M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 4.18M]
  ------------------
  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.18M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  4.18M|      SetOppositeCorners(corner_a, corner + 1);
  612|  4.18M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  4.18M|      const VertexIndex vert_a_prev =
  616|  4.18M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  4.18M|      const VertexIndex vert_b_next =
  618|  4.18M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  4.18M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 4.18M]
  |  Branch (619:38): [True: 0, False: 4.18M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  4.18M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  4.18M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  4.18M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  4.18M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  4.18M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  4.18M|      active_corner_stack.back() = corner;
  631|  6.27M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 2.16M, False: 4.11M]
  |  Branch (631:40): [True: 874k, False: 3.23M]
  ------------------
  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.04M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 3.04M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  3.04M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  3.04M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 3.04M]
  ------------------
  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.04M|      const CornerIndex corner(3 * face.value());
  658|  3.04M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  3.04M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 2.16M, False: 874k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  2.16M|        opp_corner = corner + 2;
  662|  2.16M|        corner_l = corner + 1;
  663|  2.16M|        corner_r = corner;
  664|  2.16M|      } else {
  665|       |        // "l" is the new first corner.
  666|   874k|        opp_corner = corner + 1;
  667|   874k|        corner_l = corner;
  668|   874k|        corner_r = corner + 2;
  669|   874k|      }
  670|  3.04M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  3.04M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  3.04M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 0, False: 3.04M]
  ------------------
  675|      0|        return -1;  // Unexpected number of decoded vertices.
  676|      0|      }
  677|       |
  678|  3.04M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  3.04M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  3.04M|      const VertexIndex vertex_r =
  682|  3.04M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  3.04M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  3.04M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  3.04M|      corner_table_->MapCornerToVertex(
  688|  3.04M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  3.04M|      active_corner_stack.back() = corner;
  690|  3.04M|      check_topology_split = true;
  691|  3.23M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 984k, False: 2.25M]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|   984k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 984k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|   984k|      const CornerIndex corner_b = active_corner_stack.back();
  706|   984k|      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|   984k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|   984k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 65, False: 984k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     65|        active_corner_stack.push_back(it->second);
  714|     65|      }
  715|   984k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 6, False: 984k]
  ------------------
  716|      6|        return -1;
  717|      6|      }
  718|   984k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|   984k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 984k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|   984k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 8, False: 984k]
  |  Branch (724:11): [True: 8, False: 984k]
  ------------------
  725|   984k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 984k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      8|        return -1;
  729|      8|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|   984k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|   984k|      SetOppositeCorners(corner_a, corner + 2);
  735|   984k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|   984k|      const VertexIndex vertex_p =
  739|   984k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|   984k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|   984k|      corner_table_->MapCornerToVertex(
  742|   984k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|   984k|      const VertexIndex vert_b_prev =
  744|   984k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|   984k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|   984k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|   984k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|   984k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|   984k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|   984k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|   984k|                                       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|   984k|      const CornerIndex first_corner = corner_n;
  757|  6.46M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 5.47M, False: 984k]
  ------------------
  758|  5.47M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  5.47M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  5.47M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 2, False: 5.47M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      2|          return -1;
  764|      2|        }
  765|  5.47M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|   984k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|   984k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 26.2k, False: 957k]
  ------------------
  770|  26.2k|        invalid_vertices.push_back(vertex_n);
  771|  26.2k|      }
  772|   984k|      active_corner_stack.back() = corner;
  773|  2.25M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 2.25M, False: 0]
  ------------------
  774|  2.25M|      const CornerIndex corner(3 * face.value());
  775|  2.25M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  2.25M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  2.25M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  2.25M|                                       corner_table_->AddNewVertex());
  780|  2.25M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  2.25M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  2.25M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 2, False: 2.25M]
  ------------------
  784|      2|        return -1;  // Unexpected number of decoded vertices.
  785|      2|      }
  786|       |
  787|  2.25M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  2.25M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  2.25M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  2.25M|      active_corner_stack.push_back(corner);
  792|  2.25M|      check_topology_split = true;
  793|  2.25M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      0|      return -1;
  796|      0|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  10.4M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  10.4M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 5.29M, False: 5.17M]
  ------------------
  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.29M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  5.29M|      EdgeFaceName split_edge;
  812|  5.29M|      int encoder_split_symbol_id;
  813|  5.29M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 2.25k, False: 5.29M]
  ------------------
  814|  5.29M|                             &encoder_split_symbol_id)) {
  815|  2.25k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 31, False: 2.22k]
  ------------------
  816|     31|          return -1;  // Wrong split symbol id.
  817|     31|        }
  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.22k|        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.22k|        CornerIndex new_active_corner;
  831|  2.22k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 894, False: 1.32k]
  ------------------
  832|    894|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.32k|        } else {
  834|  1.32k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.32k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  2.22k|        const int decoder_split_symbol_id =
  839|  2.22k|            num_symbols - encoder_split_symbol_id - 1;
  840|  2.22k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  2.22k|            new_active_corner;
  842|  2.22k|      }
  843|  5.29M|    }
  844|  10.4M|  }
  845|  2.29k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 2.29k]
  ------------------
  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|  40.5k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 38.3k, False: 2.27k]
  ------------------
  850|  38.3k|    const CornerIndex corner = active_corner_stack.back();
  851|  38.3k|    active_corner_stack.pop_back();
  852|  38.3k|    const bool interior_face =
  853|  38.3k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  38.3k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 27.5k, False: 10.7k]
  ------------------
  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|  27.5k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 5, False: 27.5k]
  ------------------
  877|      5|        return -1;  // More faces than expected added to the mesh.
  878|      5|      }
  879|       |
  880|  27.5k|      const CornerIndex corner_a = corner;
  881|  27.5k|      const VertexIndex vert_n =
  882|  27.5k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  27.5k|      const CornerIndex corner_b =
  884|  27.5k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  27.5k|      const VertexIndex vert_x =
  887|  27.5k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  27.5k|      const CornerIndex corner_c =
  889|  27.5k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  27.5k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 7, False: 27.5k]
  |  Branch (891:33): [True: 7, False: 27.5k]
  |  Branch (891:55): [True: 0, False: 27.5k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     14|        return -1;
  894|     14|      }
  895|  27.5k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 27.5k]
  |  Branch (895:11): [True: 1, False: 27.5k]
  ------------------
  896|  27.5k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 27.5k]
  ------------------
  897|  27.5k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 27.5k]
  ------------------
  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|  27.5k|      const VertexIndex vert_p =
  904|  27.5k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  27.5k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  27.5k|      const CornerIndex new_corner(3 * face.value());
  909|  27.5k|      SetOppositeCorners(new_corner, corner);
  910|  27.5k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  27.5k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  27.5k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  27.5k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  27.5k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|   110k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 82.5k, False: 27.5k]
  ------------------
  920|  82.5k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  82.5k|      }
  922|       |
  923|  27.5k|      init_face_configurations_.push_back(true);
  924|  27.5k|      init_corners_.push_back(new_corner);
  925|  27.5k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  10.7k|      init_face_configurations_.push_back(false);
  930|  10.7k|      init_corners_.push_back(corner);
  931|  10.7k|    }
  932|  38.3k|  }
  933|  2.27k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 18, False: 2.25k]
  ------------------
  934|     18|    return -1;  // Unexpected number of decoded faces.
  935|     18|  }
  936|       |
  937|  2.25k|  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.25k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 266, False: 2.25k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    266|    VertexIndex src_vert(num_vertices - 1);
  943|    305|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 39, False: 266]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     39|      src_vert = VertexIndex(--num_vertices - 1);
  946|     39|    }
  947|    266|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 39, False: 227]
  ------------------
  948|     39|      continue;  // No need to swap anything.
  949|     39|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    227|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  1.08k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 862, False: 227]
  ------------------
  954|    862|      const CornerIndex cid = vcit.Corner();
  955|    862|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 0, False: 862]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      0|        return -1;
  959|      0|      }
  960|    862|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|    862|    }
  962|    227|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    227|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    227|    corner_table_->MakeVertexIsolated(src_vert);
  967|    227|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    227|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    227|    num_vertices--;
  972|    227|  }
  973|  2.25k|  return num_vertices;
  974|  2.25k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.72k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.72k|  uint32_t num_topology_splits;
  982|  2.72k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.72k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.72k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 133, False: 2.58k]
  ------------------
  984|    133|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 133]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|    133|  } else
  989|  2.58k|#endif
  990|  2.58k|  {
  991|  2.58k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 2.58k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  2.58k|  }
  995|  2.72k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.69k, False: 1.02k]
  ------------------
  996|  1.69k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 19, False: 1.67k]
  ------------------
  997|  1.69k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     19|      return -1;
  999|     19|    }
 1000|  1.67k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.67k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.67k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 69, False: 1.60k]
  ------------------
 1002|   109k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 109k, False: 26]
  ------------------
 1003|   109k|        TopologySplitEventData event_data;
 1004|   109k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 24, False: 109k]
  ------------------
 1005|     24|          return -1;
 1006|     24|        }
 1007|   109k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 14, False: 109k]
  ------------------
 1008|     14|          return -1;
 1009|     14|        }
 1010|   109k|        uint8_t edge_data;
 1011|   109k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 5, False: 109k]
  ------------------
 1012|      5|          return -1;
 1013|      5|        }
 1014|   109k|        event_data.source_edge = edge_data & 1;
 1015|   109k|        topology_split_data_.push_back(event_data);
 1016|   109k|      }
 1017|       |
 1018|     69|    } else
 1019|  1.60k|#endif
 1020|  1.60k|    {
 1021|       |      // Decode source and split symbol ids using delta and varint coding. See
 1022|       |      // description in mesh_edgebreaker_encoder_impl.cc for more details.
 1023|  1.60k|      int last_source_symbol_id = 0;
 1024|  7.44k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 5.85k, False: 1.59k]
  ------------------
 1025|  5.85k|        TopologySplitEventData event_data;
 1026|  5.85k|        uint32_t delta;
 1027|  5.85k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 6, False: 5.84k]
  ------------------
 1028|      6|          return -1;
 1029|      6|        }
 1030|  5.84k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  5.84k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 2, False: 5.84k]
  ------------------
 1032|      2|          return -1;
 1033|      2|        }
 1034|  5.84k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 8, False: 5.83k]
  ------------------
 1035|      8|          return -1;
 1036|      8|        }
 1037|  5.83k|        event_data.split_symbol_id =
 1038|  5.83k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  5.83k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  5.83k|        topology_split_data_.push_back(event_data);
 1041|  5.83k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.59k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  6.94k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 5.35k, False: 1.59k]
  ------------------
 1045|  5.35k|        uint32_t edge_data;
 1046|  5.35k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.35k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.43k, False: 3.91k]
  ------------------
 1047|  1.43k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.91k|        } else {
 1049|  3.91k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.91k|        }
 1051|  5.35k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  5.35k|        event_data.source_edge = edge_data & 1;
 1053|  5.35k|      }
 1054|  1.59k|      decoder_buffer->EndBitDecoding();
 1055|  1.59k|    }
 1056|  1.67k|  }
 1057|  2.64k|  uint32_t num_hole_events = 0;
 1058|  2.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.64k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 75, False: 2.56k]
  ------------------
 1060|     75|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 4, False: 71]
  ------------------
 1061|      4|      return -1;
 1062|      4|    }
 1063|  2.56k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 385, False: 2.18k]
  ------------------
 1064|    385|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 5, False: 380]
  ------------------
 1065|      5|      return -1;
 1066|      5|    }
 1067|    385|  }
 1068|  2.63k|#endif
 1069|  2.63k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 72, False: 2.56k]
  ------------------
 1070|     72|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     72|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     72|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 48, False: 24]
  ------------------
 1072|   111k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 111k, False: 2]
  ------------------
 1073|   111k|        HoleEventData event_data;
 1074|   111k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 46, False: 111k]
  ------------------
 1075|     46|          return -1;
 1076|     46|        }
 1077|   111k|        hole_event_data_.push_back(event_data);
 1078|   111k|      }
 1079|       |
 1080|     48|    } else
 1081|     24|#endif
 1082|     24|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     24|      int last_symbol_id = 0;
 1085|   331k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 331k, False: 7]
  ------------------
 1086|   331k|        HoleEventData event_data;
 1087|   331k|        uint32_t delta;
 1088|   331k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 17, False: 331k]
  ------------------
 1089|     17|          return -1;
 1090|     17|        }
 1091|   331k|        event_data.symbol_id = delta + last_symbol_id;
 1092|   331k|        last_symbol_id = event_data.symbol_id;
 1093|   331k|        hole_event_data_.push_back(event_data);
 1094|   331k|      }
 1095|     24|    }
 1096|     72|  }
 1097|  2.57k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.63k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.82k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.82k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.82k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  7.30k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 5.47k, False: 1.82k]
  ------------------
 1109|  5.47k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  5.47k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.43k, False: 4.04k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  2.87k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.43k, False: 1.43k]
  ------------------
 1114|  1.43k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.43k|      }
 1116|  1.43k|      continue;
 1117|  1.43k|    }
 1118|       |
 1119|  8.08k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 4.04k, False: 4.04k]
  ------------------
 1120|  4.04k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  4.04k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 3.33k, False: 702]
  ------------------
 1122|  3.33k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  3.33k|      }
 1124|  4.04k|    }
 1125|  4.04k|  }
 1126|  1.82k|  return true;
 1127|  1.82k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   358k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   358k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   358k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   358k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.43M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 1.07M, False: 358k]
  ------------------
 1139|  1.07M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  1.07M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 50.4k, False: 1.02M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   301k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 250k, False: 50.4k]
  ------------------
 1144|   250k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   250k|      }
 1146|  50.4k|      continue;
 1147|  50.4k|    }
 1148|  1.02M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  1.02M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 513k, False: 513k]
  ------------------
 1151|   513k|      continue;
 1152|   513k|    }
 1153|       |
 1154|  3.51M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 3.00M, False: 513k]
  ------------------
 1155|  3.00M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  3.00M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 2.61M, False: 391k]
  ------------------
 1157|  2.61M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  2.61M|      }
 1159|  3.00M|    }
 1160|   513k|  }
 1161|   358k|  return true;
 1162|   358k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  2.25k|    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.25k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  2.25k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 35, False: 2.21k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  2.34k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 2.31k, False: 35]
  ------------------
 1176|  2.31k|      Mesh::Face face;
 1177|  2.31k|      const CornerIndex start_corner(3 * f.value());
 1178|  9.24k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 6.93k, False: 2.31k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  6.93k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  6.93k|        face[c] = vert_id;
 1182|  6.93k|      }
 1183|  2.31k|      decoder_->mesh()->SetFace(f, face);
 1184|  2.31k|    }
 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.21k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  2.21k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   205k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 203k, False: 2.20k]
  ------------------
 1197|   203k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   203k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 10.4k, False: 192k]
  ------------------
 1199|  10.4k|      continue;  // Isolated vertex.
 1200|  10.4k|    }
 1201|   192k|    CornerIndex deduplication_first_corner = c;
 1202|   192k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 47.8k, False: 144k]
  ------------------
 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|  47.8k|      deduplication_first_corner = c;
 1206|   144k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   157k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 153k, False: 3.50k]
  ------------------
 1210|   153k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 7.19k, False: 146k]
  ------------------
 1211|  7.19k|          continue;  // No seam for this attribute, ignore it.
 1212|  7.19k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|   146k|        const VertexIndex vert_id =
 1217|   146k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   146k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   146k|        bool seam_found = false;
 1220|   156k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 151k, False: 5.45k]
  ------------------
 1221|   151k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 9, False: 151k]
  ------------------
 1222|      9|            return false;
 1223|      9|          }
 1224|   151k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 141k, False: 10.1k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   141k|            deduplication_first_corner = act_c;
 1227|   141k|            seam_found = true;
 1228|   141k|            break;
 1229|   141k|          }
 1230|  10.1k|          act_c = corner_table_->SwingRight(act_c);
 1231|  10.1k|        }
 1232|   146k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 141k, False: 5.45k]
  ------------------
 1233|   141k|          break;  // No reason to process other attributes if we found a seam.
 1234|   141k|        }
 1235|   146k|      }
 1236|   144k|    }
 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|   192k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   192k|    corner_to_point_map[c.value()] =
 1246|   192k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   192k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   192k|    CornerIndex prev_c = c;
 1250|   192k|    c = corner_table_->SwingRight(c);
 1251|  1.00M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 960k, False: 48.0k]
  |  Branch (1251:40): [True: 815k, False: 144k]
  ------------------
 1252|   815k|      bool attribute_seam = false;
 1253|   873k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 855k, False: 18.3k]
  ------------------
 1254|   855k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 797k, False: 57.6k]
  ------------------
 1255|   855k|            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|   797k|          attribute_seam = true;
 1259|   797k|          break;
 1260|   797k|        }
 1261|   855k|      }
 1262|   815k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 797k, False: 18.3k]
  ------------------
 1263|   797k|        corner_to_point_map[c.value()] =
 1264|   797k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   797k|        point_to_corner_map.push_back(c.value());
 1266|   797k|      } else {
 1267|  18.3k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  18.3k|      }
 1269|   815k|      prev_c = c;
 1270|   815k|      c = corner_table_->SwingRight(c);
 1271|   815k|    }
 1272|   192k|  }
 1273|       |  // Add faces.
 1274|   312k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 310k, False: 2.20k]
  ------------------
 1275|   310k|    Mesh::Face face;
 1276|  1.24M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 932k, False: 310k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   932k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   932k|    }
 1280|   310k|    decoder_->mesh()->SetFace(f, face);
 1281|   310k|  }
 1282|  2.20k|  decoder_->point_cloud()->set_num_points(
 1283|  2.20k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  2.20k|  return true;
 1285|  2.21k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  2.59k|    : decoder_(nullptr),
   49|  2.59k|      last_symbol_id_(-1),
   50|  2.59k|      last_vert_id_(-1),
   51|  2.59k|      last_face_id_(-1),
   52|  2.59k|      num_new_vertices_(0),
   53|  2.59k|      num_encoded_vertices_(0),
   54|  2.59k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.59k|    MeshEdgebreakerDecoder* decoder) {
   59|  2.59k|  decoder_ = decoder;
   60|  2.59k|  return true;
   61|  2.59k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  2.56k|    int att_id) const {
   67|  3.87k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 3.11k, False: 756]
  ------------------
   68|  3.11k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  3.11k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.30k, False: 1.80k]
  |  Branch (69:27): [True: 0, False: 1.80k]
  ------------------
   70|  1.30k|      continue;
   71|  1.30k|    }
   72|  1.80k|    const AttributesDecoderInterface* const dec =
   73|  1.80k|        decoder_->attributes_decoder(decoder_id);
   74|  4.49k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 4.49k, False: 0]
  ------------------
   75|  4.49k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.80k, False: 2.68k]
  ------------------
   76|  1.80k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.12k, False: 685]
  ------------------
   77|  1.12k|          return &attribute_data_[i].connectivity_data;
   78|  1.12k|        }
   79|    685|        return nullptr;
   80|  1.80k|      }
   81|  4.49k|    }
   82|  1.80k|  }
   83|    756|  return nullptr;
   84|  2.56k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  2.56k|    int att_id) const {
   90|  3.87k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 3.11k, False: 756]
  ------------------
   91|  3.11k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  3.11k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.30k, False: 1.80k]
  |  Branch (92:27): [True: 0, False: 1.80k]
  ------------------
   93|  1.30k|      continue;
   94|  1.30k|    }
   95|  1.80k|    const AttributesDecoderInterface* const dec =
   96|  1.80k|        decoder_->attributes_decoder(decoder_id);
   97|  4.49k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 4.49k, False: 0]
  ------------------
   98|  4.49k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.80k, False: 2.68k]
  ------------------
   99|  1.80k|        return &attribute_data_[i].encoding_data;
  100|  1.80k|      }
  101|  4.49k|    }
  102|  1.80k|  }
  103|    756|  return &pos_encoding_data_;
  104|  2.56k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  2.15k|    int32_t att_decoder_id) {
  131|  2.15k|  int8_t att_data_id;
  132|  2.15k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 19, False: 2.13k]
  ------------------
  133|     19|    return false;
  134|     19|  }
  135|  2.13k|  uint8_t decoder_type;
  136|  2.13k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 10, False: 2.12k]
  ------------------
  137|     10|    return false;
  138|     10|  }
  139|       |
  140|  2.12k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.53k, False: 584]
  ------------------
  141|  1.53k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 45, False: 1.49k]
  ------------------
  142|     45|      return false;  // Unexpected attribute data.
  143|     45|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.49k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 3, False: 1.49k]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|       |
  151|  1.49k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.49k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    584|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 583]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    583|    pos_data_decoder_id_ = att_decoder_id;
  158|    583|  }
  159|       |
  160|  2.07k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  2.07k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  2.07k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 2.07k, False: 0]
  ------------------
  162|  2.07k|    uint8_t traversal_method_encoded;
  163|  2.07k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 2, False: 2.07k]
  ------------------
  164|      2|      return false;
  165|      2|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  2.07k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 12, False: 2.05k]
  ------------------
  168|     12|      return false;
  169|     12|    }
  170|  2.05k|    traversal_method =
  171|  2.05k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  2.05k|  }
  173|       |
  174|  2.05k|  const Mesh* mesh = decoder_->mesh();
  175|  2.05k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  2.05k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1.11k, False: 940]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|  1.11k|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|  1.11k|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 571, False: 548]
  ------------------
  182|    571|      encoding_data = &pos_encoding_data_;
  183|    571|    } else {
  184|    548|      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|    548|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    548|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|  1.11k|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 242, False: 877]
  ------------------
  191|    242|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    242|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    242|          AttTraverser;
  194|    242|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    877|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 877, False: 0]
  ------------------
  196|    877|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    877|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    877|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    877|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|  1.11k|  } else {
  203|    940|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 3, False: 937]
  ------------------
  204|      3|      return false;  // Unsupported method.
  205|      3|    }
  206|    937|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 5, False: 932]
  ------------------
  207|      5|      return false;  // Attribute data must be specified.
  208|      5|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    932|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    932|        AttObserver;
  214|    932|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    932|        AttTraverser;
  216|       |
  217|    932|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|    932|        &attribute_data_[att_data_id].encoding_data;
  219|    932|    const MeshAttributeCornerTable* const corner_table =
  220|    932|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    932|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    932|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    932|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    932|                             encoding_data);
  227|       |
  228|    932|    AttTraverser att_traverser;
  229|    932|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    932|    traversal_sequencer->SetTraverser(att_traverser);
  232|    932|    sequencer = std::move(traversal_sequencer);
  233|    932|  }
  234|       |
  235|  2.05k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 2.05k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  2.05k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  2.05k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  2.05k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  2.05k|                                        std::move(att_controller));
  244|  2.05k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  2.59k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.59k|  num_new_vertices_ = 0;
  249|  2.59k|  new_to_parent_vertex_map_.clear();
  250|  2.59k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.59k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.59k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 177, False: 2.41k]
  ------------------
  252|    177|    uint32_t num_new_verts;
  253|    177|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    177|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 134, False: 43]
  ------------------
  254|    134|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 134]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    134|    } else {
  258|     43|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 43]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|     43|    }
  262|    177|    num_new_vertices_ = num_new_verts;
  263|    177|  }
  264|  2.59k|#endif
  265|       |
  266|  2.59k|  uint32_t num_encoded_vertices;
  267|  2.59k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.59k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.59k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 134, False: 2.45k]
  ------------------
  269|    134|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 134]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    134|  } else
  274|  2.45k|#endif
  275|  2.45k|  {
  276|  2.45k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 2.45k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  2.45k|  }
  280|  2.59k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.59k|  uint32_t num_faces;
  283|  2.59k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.59k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.59k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 134, False: 2.45k]
  ------------------
  285|    134|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 134]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    134|  } else
  290|  2.45k|#endif
  291|  2.45k|  {
  292|  2.45k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 2.45k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  2.45k|  }
  296|  2.59k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 1, False: 2.59k]
  ------------------
  297|      1|    return false;  // Draco cannot handle this many faces.
  298|      1|  }
  299|       |
  300|  2.59k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 2, False: 2.58k]
  ------------------
  301|      2|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      2|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.58k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  2.58k|  const uint64_t num_encoded_vertices_64 =
  311|  2.58k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.58k|  const uint64_t max_num_vertex_edges =
  313|  2.58k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.58k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 1, False: 2.58k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      1|    return false;
  317|      1|  }
  318|       |
  319|  2.58k|  uint8_t num_attribute_data;
  320|  2.58k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.58k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.58k|  uint32_t num_encoded_symbols;
  325|  2.58k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.58k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.58k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 131, False: 2.45k]
  ------------------
  327|    131|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 131]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    131|  } else
  332|  2.45k|#endif
  333|  2.45k|  {
  334|  2.45k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 2.45k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  2.45k|  }
  338|       |
  339|  2.58k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 12, False: 2.57k]
  ------------------
  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|     12|    return false;
  344|     12|  }
  345|  2.57k|  const uint32_t max_encoded_faces =
  346|  2.57k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.57k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 11, False: 2.56k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|     11|    return false;
  352|     11|  }
  353|       |
  354|  2.56k|  uint32_t num_encoded_split_symbols;
  355|  2.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.56k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 114, False: 2.45k]
  ------------------
  357|    114|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 114]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    114|  } else
  362|  2.45k|#endif
  363|  2.45k|  {
  364|  2.45k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 2.45k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  2.45k|  }
  368|       |
  369|  2.56k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 2, False: 2.56k]
  ------------------
  370|      2|    return false;  // Split symbols are a sub-set of all symbols.
  371|      2|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.56k|  vertex_traversal_length_.clear();
  375|  2.56k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.56k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.56k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.56k|  processed_corner_ids_.clear();
  380|  2.56k|  processed_corner_ids_.reserve(num_faces);
  381|  2.56k|  processed_connectivity_corners_.clear();
  382|  2.56k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.56k|  topology_split_data_.clear();
  384|  2.56k|  hole_event_data_.clear();
  385|  2.56k|  init_face_configurations_.clear();
  386|  2.56k|  init_corners_.clear();
  387|       |
  388|  2.56k|  last_symbol_id_ = -1;
  389|  2.56k|  last_face_id_ = -1;
  390|  2.56k|  last_vert_id_ = -1;
  391|       |
  392|  2.56k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.56k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.56k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 2.56k]
  ------------------
  397|  2.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|  2.56k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.56k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.56k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 155, False: 2.40k]
  ------------------
  411|    155|    uint32_t encoded_connectivity_size;
  412|    155|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    155|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 112, False: 43]
  ------------------
  413|    112|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 112]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|    112|    } else {
  417|     43|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 43]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|     43|    }
  421|    155|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 0, False: 155]
  ------------------
  422|    155|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 17, False: 138]
  ------------------
  423|     17|      return false;
  424|     17|    }
  425|    138|    DecoderBuffer event_buffer;
  426|    138|    event_buffer.Init(
  427|    138|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    138|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    138|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    138|    topology_split_decoded_bytes =
  432|    138|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    138|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 99, False: 39]
  ------------------
  434|     99|      return false;
  435|     99|    }
  436|       |
  437|    138|  } else
  438|  2.40k|#endif
  439|  2.40k|  {
  440|  2.40k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 22, False: 2.38k]
  ------------------
  441|     22|      return false;
  442|     22|    }
  443|  2.40k|  }
  444|       |
  445|  2.42k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.42k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.42k|                                           num_encoded_split_symbols);
  449|  2.42k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.42k|  DecoderBuffer traversal_end_buffer;
  452|  2.42k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 84, False: 2.34k]
  ------------------
  453|     84|    return false;
  454|     84|  }
  455|       |
  456|  2.34k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  2.34k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 164, False: 2.17k]
  ------------------
  458|    164|    return false;
  459|    164|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  2.17k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  2.17k|                           traversal_end_buffer.remaining_size(),
  464|  2.17k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  2.17k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  2.17k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.17k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 16, False: 2.16k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|     16|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|     16|  }
  471|  2.17k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  2.17k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 2.15k, False: 26]
  ------------------
  475|  2.15k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  2.15k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.15k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 16, False: 2.13k]
  ------------------
  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.13k|#endif
  485|  2.13k|    {
  486|  13.4M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 13.4M, False: 2.13k]
  ------------------
  487|  13.4M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 13.4M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  13.4M|      }
  491|  2.13k|    }
  492|  2.15k|  }
  493|  2.17k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  4.83k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 2.65k, False: 2.17k]
  ------------------
  498|  2.65k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  18.5M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 18.5M, False: 2.65k]
  ------------------
  501|  18.5M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  18.5M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  2.65k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 2.65k]
  ------------------
  505|  2.65k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  2.65k|  }
  509|       |
  510|  2.17k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  4.83k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 2.65k, False: 2.17k]
  ------------------
  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.65k|    int32_t att_connectivity_verts =
  517|  2.65k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  2.65k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 165, False: 2.49k]
  ------------------
  519|    165|      att_connectivity_verts = corner_table_->num_vertices();
  520|    165|    }
  521|  2.65k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  2.65k|  }
  523|  2.17k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 2, False: 2.17k]
  ------------------
  524|      2|    return false;
  525|      2|  }
  526|  2.17k|  return true;
  527|  2.17k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    777|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    777|  return true;
  532|    777|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  2.34k|    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.34k|  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.34k|  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.34k|  std::vector<VertexIndex> invalid_vertices;
  558|  2.34k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  2.34k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  2.34k|  int num_faces = 0;
  562|  66.6M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 66.6M, False: 2.25k]
  ------------------
  563|  66.6M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  66.6M|    bool check_topology_split = false;
  566|  66.6M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  66.6M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 33.1M, False: 33.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|  33.1M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 33.1M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  33.1M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  33.1M|      const VertexIndex vertex_x =
  593|  33.1M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  33.1M|      const CornerIndex corner_b =
  595|  33.1M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  33.1M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 43, False: 33.1M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     43|        return -1;
  600|     43|      }
  601|  33.1M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 33.1M]
  |  Branch (601:11): [True: 0, False: 33.1M]
  ------------------
  602|  33.1M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 33.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|  33.1M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  33.1M|      SetOppositeCorners(corner_a, corner + 1);
  612|  33.1M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  33.1M|      const VertexIndex vert_a_prev =
  616|  33.1M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  33.1M|      const VertexIndex vert_b_next =
  618|  33.1M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  33.1M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 33.1M]
  |  Branch (619:38): [True: 0, False: 33.1M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  33.1M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  33.1M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  33.1M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  33.1M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  33.1M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  33.1M|      active_corner_stack.back() = corner;
  631|  33.5M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 33.5M, False: 45.2k]
  |  Branch (631:40): [True: 10.1k, False: 35.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|  33.5M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 33.5M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  33.5M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  33.5M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 33.5M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  33.5M|      const CornerIndex corner(3 * face.value());
  658|  33.5M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  33.5M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 33.5M, False: 10.1k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  33.5M|        opp_corner = corner + 2;
  662|  33.5M|        corner_l = corner + 1;
  663|  33.5M|        corner_r = corner;
  664|  33.5M|      } else {
  665|       |        // "l" is the new first corner.
  666|  10.1k|        opp_corner = corner + 1;
  667|  10.1k|        corner_l = corner;
  668|  10.1k|        corner_r = corner + 2;
  669|  10.1k|      }
  670|  33.5M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  33.5M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  33.5M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 7, False: 33.5M]
  ------------------
  675|      7|        return -1;  // Unexpected number of decoded vertices.
  676|      7|      }
  677|       |
  678|  33.5M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  33.5M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  33.5M|      const VertexIndex vertex_r =
  682|  33.5M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  33.5M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  33.5M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  33.5M|      corner_table_->MapCornerToVertex(
  688|  33.5M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  33.5M|      active_corner_stack.back() = corner;
  690|  33.5M|      check_topology_split = true;
  691|  33.5M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 11.5k, 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|  11.5k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 11.5k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  11.5k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  11.5k|      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|  11.5k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  11.5k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 33, False: 11.4k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     33|        active_corner_stack.push_back(it->second);
  714|     33|      }
  715|  11.5k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 5, False: 11.5k]
  ------------------
  716|      5|        return -1;
  717|      5|      }
  718|  11.5k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  11.5k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 11.5k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  11.5k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 8, False: 11.5k]
  |  Branch (724:11): [True: 8, False: 11.5k]
  ------------------
  725|  11.5k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 11.5k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      8|        return -1;
  729|      8|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  11.5k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  11.5k|      SetOppositeCorners(corner_a, corner + 2);
  735|  11.5k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  11.5k|      const VertexIndex vertex_p =
  739|  11.5k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  11.5k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  11.5k|      corner_table_->MapCornerToVertex(
  742|  11.5k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  11.5k|      const VertexIndex vert_b_prev =
  744|  11.5k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  11.5k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  11.5k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  11.5k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  11.5k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  11.5k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  11.5k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  11.5k|                                       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|  11.5k|      const CornerIndex first_corner = corner_n;
  757|  46.3k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 34.8k, False: 11.5k]
  ------------------
  758|  34.8k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  34.8k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  34.8k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 34.8k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  34.8k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  11.5k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  11.5k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 4.68k, False: 6.81k]
  ------------------
  770|  4.68k|        invalid_vertices.push_back(vertex_n);
  771|  4.68k|      }
  772|  11.5k|      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: 2, False: 23.6k]
  ------------------
  784|      2|        return -1;  // Unexpected number of decoded vertices.
  785|      2|      }
  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|  66.6M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  66.6M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 33.5M, False: 33.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|  33.5M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  33.5M|      EdgeFaceName split_edge;
  812|  33.5M|      int encoder_split_symbol_id;
  813|  33.5M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.47k, False: 33.5M]
  ------------------
  814|  33.5M|                             &encoder_split_symbol_id)) {
  815|  1.47k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 21, False: 1.44k]
  ------------------
  816|     21|          return -1;  // Wrong split symbol id.
  817|     21|        }
  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.44k|        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.44k|        CornerIndex new_active_corner;
  831|  1.44k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 525, False: 924]
  ------------------
  832|    525|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    924|        } else {
  834|    924|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    924|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.44k|        const int decoder_split_symbol_id =
  839|  1.44k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.44k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.44k|            new_active_corner;
  842|  1.44k|      }
  843|  33.5M|    }
  844|  66.6M|  }
  845|  2.25k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 2.25k]
  ------------------
  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|  11.0k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 8.84k, False: 2.22k]
  ------------------
  850|  8.84k|    const CornerIndex corner = active_corner_stack.back();
  851|  8.84k|    active_corner_stack.pop_back();
  852|  8.84k|    const bool interior_face =
  853|  8.84k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  8.84k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 5.50k, False: 3.34k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  5.50k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 9, False: 5.49k]
  ------------------
  877|      9|        return -1;  // More faces than expected added to the mesh.
  878|      9|      }
  879|       |
  880|  5.49k|      const CornerIndex corner_a = corner;
  881|  5.49k|      const VertexIndex vert_n =
  882|  5.49k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  5.49k|      const CornerIndex corner_b =
  884|  5.49k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  5.49k|      const VertexIndex vert_x =
  887|  5.49k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  5.49k|      const CornerIndex corner_c =
  889|  5.49k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  5.49k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 5.49k]
  |  Branch (891:33): [True: 16, False: 5.47k]
  |  Branch (891:55): [True: 0, False: 5.47k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     18|        return -1;
  894|     18|      }
  895|  5.47k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 5.47k]
  |  Branch (895:11): [True: 1, False: 5.47k]
  ------------------
  896|  5.47k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 5.47k]
  ------------------
  897|  5.47k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 5.47k]
  ------------------
  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|  5.47k|      const VertexIndex vert_p =
  904|  5.47k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  5.47k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  5.47k|      const CornerIndex new_corner(3 * face.value());
  909|  5.47k|      SetOppositeCorners(new_corner, corner);
  910|  5.47k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  5.47k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  5.47k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  5.47k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  5.47k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  21.9k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 16.4k, False: 5.47k]
  ------------------
  920|  16.4k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  16.4k|      }
  922|       |
  923|  5.47k|      init_face_configurations_.push_back(true);
  924|  5.47k|      init_corners_.push_back(new_corner);
  925|  5.47k|    } 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.34k|      init_face_configurations_.push_back(false);
  930|  3.34k|      init_corners_.push_back(corner);
  931|  3.34k|    }
  932|  8.84k|  }
  933|  2.22k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 49, False: 2.17k]
  ------------------
  934|     49|    return -1;  // Unexpected number of decoded faces.
  935|     49|  }
  936|       |
  937|  2.17k|  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.17k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 261, False: 2.17k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    261|    VertexIndex src_vert(num_vertices - 1);
  943|    307|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 46, False: 261]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     46|      src_vert = VertexIndex(--num_vertices - 1);
  946|     46|    }
  947|    261|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 46, False: 215]
  ------------------
  948|     46|      continue;  // No need to swap anything.
  949|     46|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    215|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  1.34k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 1.13k, False: 215]
  ------------------
  954|  1.13k|      const CornerIndex cid = vcit.Corner();
  955|  1.13k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 0, False: 1.13k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      0|        return -1;
  959|      0|      }
  960|  1.13k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  1.13k|    }
  962|    215|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    215|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    215|    corner_table_->MakeVertexIsolated(src_vert);
  967|    215|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    215|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    215|    num_vertices--;
  972|    215|  }
  973|  2.17k|  return num_vertices;
  974|  2.17k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.54k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.54k|  uint32_t num_topology_splits;
  982|  2.54k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.54k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.54k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 95, False: 2.45k]
  ------------------
  984|     95|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 95]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|     95|  } else
  989|  2.45k|#endif
  990|  2.45k|  {
  991|  2.45k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 2.45k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  2.45k|  }
  995|  2.54k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 727, False: 1.81k]
  ------------------
  996|    727|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 29, False: 698]
  ------------------
  997|    727|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     29|      return -1;
  999|     29|    }
 1000|    698|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    698|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    698|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 47, False: 651]
  ------------------
 1002|   179k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 179k, False: 8]
  ------------------
 1003|   179k|        TopologySplitEventData event_data;
 1004|   179k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 18, False: 179k]
  ------------------
 1005|     18|          return -1;
 1006|     18|        }
 1007|   179k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 17, False: 179k]
  ------------------
 1008|     17|          return -1;
 1009|     17|        }
 1010|   179k|        uint8_t edge_data;
 1011|   179k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 179k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|   179k|        event_data.source_edge = edge_data & 1;
 1015|   179k|        topology_split_data_.push_back(event_data);
 1016|   179k|      }
 1017|       |
 1018|     47|    } else
 1019|    651|#endif
 1020|    651|    {
 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|    651|      int last_source_symbol_id = 0;
 1024|  3.89k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.26k, False: 639]
  ------------------
 1025|  3.26k|        TopologySplitEventData event_data;
 1026|  3.26k|        uint32_t delta;
 1027|  3.26k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 5, False: 3.25k]
  ------------------
 1028|      5|          return -1;
 1029|      5|        }
 1030|  3.25k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.25k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 1, False: 3.25k]
  ------------------
 1032|      1|          return -1;
 1033|      1|        }
 1034|  3.25k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 6, False: 3.24k]
  ------------------
 1035|      6|          return -1;
 1036|      6|        }
 1037|  3.24k|        event_data.split_symbol_id =
 1038|  3.24k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.24k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.24k|        topology_split_data_.push_back(event_data);
 1041|  3.24k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    639|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.43k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.79k, False: 639]
  ------------------
 1045|  2.79k|        uint32_t edge_data;
 1046|  2.79k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.79k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 587, False: 2.20k]
  ------------------
 1047|    587|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.20k|        } else {
 1049|  2.20k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.20k|        }
 1051|  2.79k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  2.79k|        event_data.source_edge = edge_data & 1;
 1053|  2.79k|      }
 1054|    639|      decoder_buffer->EndBitDecoding();
 1055|    639|    }
 1056|    698|  }
 1057|  2.46k|  uint32_t num_hole_events = 0;
 1058|  2.46k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.46k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.46k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 38, False: 2.42k]
  ------------------
 1060|     38|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 1, False: 37]
  ------------------
 1061|      1|      return -1;
 1062|      1|    }
 1063|  2.42k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.42k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 38, False: 2.38k]
  ------------------
 1064|     38|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 7, False: 31]
  ------------------
 1065|      7|      return -1;
 1066|      7|    }
 1067|     38|  }
 1068|  2.45k|#endif
 1069|  2.45k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 42, False: 2.41k]
  ------------------
 1070|     42|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     42|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     42|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 27, False: 15]
  ------------------
 1072|  27.7k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 27.7k, False: 3]
  ------------------
 1073|  27.7k|        HoleEventData event_data;
 1074|  27.7k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 24, False: 27.6k]
  ------------------
 1075|     24|          return -1;
 1076|     24|        }
 1077|  27.6k|        hole_event_data_.push_back(event_data);
 1078|  27.6k|      }
 1079|       |
 1080|     27|    } else
 1081|     15|#endif
 1082|     15|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     15|      int last_symbol_id = 0;
 1085|    693|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 687, False: 6]
  ------------------
 1086|    687|        HoleEventData event_data;
 1087|    687|        uint32_t delta;
 1088|    687|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 9, False: 678]
  ------------------
 1089|      9|          return -1;
 1090|      9|        }
 1091|    678|        event_data.symbol_id = delta + last_symbol_id;
 1092|    678|        last_symbol_id = event_data.symbol_id;
 1093|    678|        hole_event_data_.push_back(event_data);
 1094|    678|      }
 1095|     15|    }
 1096|     42|  }
 1097|  2.42k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.45k|}
_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: 808, False: 4.32k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  1.61k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 808, False: 808]
  ------------------
 1114|    808|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|    808|      }
 1116|    808|      continue;
 1117|    808|    }
 1118|       |
 1119|  8.65k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 4.32k, False: 4.32k]
  ------------------
 1120|  4.32k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  4.32k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 4.22k, False: 108]
  ------------------
 1122|  4.22k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  4.22k|      }
 1124|  4.32k|    }
 1125|  4.32k|  }
 1126|  1.71k|  return true;
 1127|  1.71k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  13.4M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  13.4M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  13.4M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  13.4M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  53.9M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 40.4M, False: 13.4M]
  ------------------
 1139|  40.4M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  40.4M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 192k, False: 40.2M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   391k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 199k, False: 192k]
  ------------------
 1144|   199k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   199k|      }
 1146|   192k|      continue;
 1147|   192k|    }
 1148|  40.2M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  40.2M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 20.1M, False: 20.1M]
  ------------------
 1151|  20.1M|      continue;
 1152|  20.1M|    }
 1153|       |
 1154|  40.8M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 20.6M, False: 20.1M]
  ------------------
 1155|  20.6M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  20.6M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 18.2M, False: 2.38M]
  ------------------
 1157|  18.2M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  18.2M|      }
 1159|  20.6M|    }
 1160|  20.1M|  }
 1161|  13.4M|  return true;
 1162|  13.4M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  2.17k|    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.17k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  2.17k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 26, False: 2.15k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  16.1k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 16.0k, False: 26]
  ------------------
 1176|  16.0k|      Mesh::Face face;
 1177|  16.0k|      const CornerIndex start_corner(3 * f.value());
 1178|  64.3k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 48.2k, False: 16.0k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  48.2k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  48.2k|        face[c] = vert_id;
 1182|  48.2k|      }
 1183|  16.0k|      decoder_->mesh()->SetFace(f, face);
 1184|  16.0k|    }
 1185|     26|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     26|    return true;
 1187|     26|  }
 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.15k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  2.15k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  6.85M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 6.85M, False: 2.14k]
  ------------------
 1197|  6.85M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  6.85M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 4.13k, False: 6.84M]
  ------------------
 1199|  4.13k|      continue;  // Isolated vertex.
 1200|  4.13k|    }
 1201|  6.84M|    CornerIndex deduplication_first_corner = c;
 1202|  6.84M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 192k, False: 6.65M]
  ------------------
 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|   192k|      deduplication_first_corner = c;
 1206|  6.65M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  7.37M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 6.65M, False: 718k]
  ------------------
 1210|  6.65M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 698k, False: 5.95M]
  ------------------
 1211|   698k|          continue;  // No seam for this attribute, ignore it.
 1212|   698k|        }
 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|  5.95M|        const VertexIndex vert_id =
 1217|  5.95M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  5.95M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  5.95M|        bool seam_found = false;
 1220|  6.18M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 6.16M, False: 22.9k]
  ------------------
 1221|  6.16M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 2, False: 6.16M]
  ------------------
 1222|      2|            return false;
 1223|      2|          }
 1224|  6.16M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 5.93M, False: 226k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  5.93M|            deduplication_first_corner = act_c;
 1227|  5.93M|            seam_found = true;
 1228|  5.93M|            break;
 1229|  5.93M|          }
 1230|   226k|          act_c = corner_table_->SwingRight(act_c);
 1231|   226k|        }
 1232|  5.95M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 5.93M, False: 22.9k]
  ------------------
 1233|  5.93M|          break;  // No reason to process other attributes if we found a seam.
 1234|  5.93M|        }
 1235|  5.95M|      }
 1236|  6.65M|    }
 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|  6.84M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  6.84M|    corner_to_point_map[c.value()] =
 1246|  6.84M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  6.84M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  6.84M|    CornerIndex prev_c = c;
 1250|  6.84M|    c = corner_table_->SwingRight(c);
 1251|  40.4M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 40.2M, False: 195k]
  |  Branch (1251:40): [True: 33.6M, False: 6.65M]
  ------------------
 1252|  33.6M|      bool attribute_seam = false;
 1253|  37.3M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 33.6M, False: 3.76M]
  ------------------
 1254|  33.6M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 29.8M, False: 3.78M]
  ------------------
 1255|  33.6M|            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|  29.8M|          attribute_seam = true;
 1259|  29.8M|          break;
 1260|  29.8M|        }
 1261|  33.6M|      }
 1262|  33.6M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 29.8M, False: 3.76M]
  ------------------
 1263|  29.8M|        corner_to_point_map[c.value()] =
 1264|  29.8M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  29.8M|        point_to_corner_map.push_back(c.value());
 1266|  29.8M|      } else {
 1267|  3.76M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  3.76M|      }
 1269|  33.6M|      prev_c = c;
 1270|  33.6M|      c = corner_table_->SwingRight(c);
 1271|  33.6M|    }
 1272|  6.84M|  }
 1273|       |  // Add faces.
 1274|  13.4M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 13.4M, False: 2.14k]
  ------------------
 1275|  13.4M|    Mesh::Face face;
 1276|  53.9M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 40.4M, False: 13.4M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  40.4M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  40.4M|    }
 1280|  13.4M|    decoder_->mesh()->SetFace(f, face);
 1281|  13.4M|  }
 1282|  2.14k|  decoder_->point_cloud()->set_num_points(
 1283|  2.14k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  2.14k|  return true;
 1285|  2.15k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  2.14k|    : decoder_(nullptr),
   49|  2.14k|      last_symbol_id_(-1),
   50|  2.14k|      last_vert_id_(-1),
   51|  2.14k|      last_face_id_(-1),
   52|  2.14k|      num_new_vertices_(0),
   53|  2.14k|      num_encoded_vertices_(0),
   54|  2.14k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.14k|    MeshEdgebreakerDecoder* decoder) {
   59|  2.14k|  decoder_ = decoder;
   60|  2.14k|  return true;
   61|  2.14k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    213|    int att_id) const {
   67|    327|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 248, False: 79]
  ------------------
   68|    248|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    248|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 114, False: 134]
  |  Branch (69:27): [True: 0, False: 134]
  ------------------
   70|    114|      continue;
   71|    114|    }
   72|    134|    const AttributesDecoderInterface* const dec =
   73|    134|        decoder_->attributes_decoder(decoder_id);
   74|  1.31k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 1.31k, False: 0]
  ------------------
   75|  1.31k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 134, False: 1.18k]
  ------------------
   76|    134|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 80, False: 54]
  ------------------
   77|     80|          return &attribute_data_[i].connectivity_data;
   78|     80|        }
   79|     54|        return nullptr;
   80|    134|      }
   81|  1.31k|    }
   82|    134|  }
   83|     79|  return nullptr;
   84|    213|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    213|    int att_id) const {
   90|    327|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 248, False: 79]
  ------------------
   91|    248|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    248|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 114, False: 134]
  |  Branch (92:27): [True: 0, False: 134]
  ------------------
   93|    114|      continue;
   94|    114|    }
   95|    134|    const AttributesDecoderInterface* const dec =
   96|    134|        decoder_->attributes_decoder(decoder_id);
   97|  1.31k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 1.31k, False: 0]
  ------------------
   98|  1.31k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 134, False: 1.18k]
  ------------------
   99|    134|        return &attribute_data_[i].encoding_data;
  100|    134|      }
  101|  1.31k|    }
  102|    134|  }
  103|     79|  return &pos_encoding_data_;
  104|    213|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    173|    int32_t att_decoder_id) {
  131|    173|  int8_t att_data_id;
  132|    173|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 5, False: 168]
  ------------------
  133|      5|    return false;
  134|      5|  }
  135|    168|  uint8_t decoder_type;
  136|    168|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 5, False: 163]
  ------------------
  137|      5|    return false;
  138|      5|  }
  139|       |
  140|    163|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 105, False: 58]
  ------------------
  141|    105|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 20, False: 85]
  ------------------
  142|     20|      return false;  // Unexpected attribute data.
  143|     20|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|     85|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 3, False: 82]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|       |
  151|     82|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|     82|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|     58|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 56]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|     56|    pos_data_decoder_id_ = att_decoder_id;
  158|     56|  }
  159|       |
  160|    138|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    138|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    138|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 138, False: 0]
  ------------------
  162|    138|    uint8_t traversal_method_encoded;
  163|    138|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 2, False: 136]
  ------------------
  164|      2|      return false;
  165|      2|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    136|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 20, False: 116]
  ------------------
  168|     20|      return false;
  169|     20|    }
  170|    116|    traversal_method =
  171|    116|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    116|  }
  173|       |
  174|    116|  const Mesh* mesh = decoder_->mesh();
  175|    116|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    116|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 52, False: 64]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|     52|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|     52|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 31, False: 21]
  ------------------
  182|     31|      encoding_data = &pos_encoding_data_;
  183|     31|    } else {
  184|     21|      encoding_data = &attribute_data_[att_data_id].encoding_data;
  185|       |      // Mark the attribute connectivity data invalid to ensure it's not used
  186|       |      // later on.
  187|     21|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     21|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|     52|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 24, False: 28]
  ------------------
  191|     24|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     24|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     24|          AttTraverser;
  194|     24|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|     28|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 28, False: 0]
  ------------------
  196|     28|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|     28|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|     28|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|     28|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|     64|  } else {
  203|     64|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 2, False: 62]
  ------------------
  204|      2|      return false;  // Unsupported method.
  205|      2|    }
  206|     62|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 5, False: 57]
  ------------------
  207|      5|      return false;  // Attribute data must be specified.
  208|      5|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     57|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     57|        AttObserver;
  214|     57|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     57|        AttTraverser;
  216|       |
  217|     57|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|     57|        &attribute_data_[att_data_id].encoding_data;
  219|     57|    const MeshAttributeCornerTable* const corner_table =
  220|     57|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     57|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     57|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     57|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     57|                             encoding_data);
  227|       |
  228|     57|    AttTraverser att_traverser;
  229|     57|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     57|    traversal_sequencer->SetTraverser(att_traverser);
  232|     57|    sequencer = std::move(traversal_sequencer);
  233|     57|  }
  234|       |
  235|    109|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 109]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|    109|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|    109|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|    109|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|    109|                                        std::move(att_controller));
  244|    109|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  2.14k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.14k|  num_new_vertices_ = 0;
  249|  2.14k|  new_to_parent_vertex_map_.clear();
  250|  2.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.14k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 318, False: 1.82k]
  ------------------
  252|    318|    uint32_t num_new_verts;
  253|    318|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    318|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 229, False: 89]
  ------------------
  254|    229|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 229]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    229|    } else {
  258|     89|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 89]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|     89|    }
  262|    318|    num_new_vertices_ = num_new_verts;
  263|    318|  }
  264|  2.14k|#endif
  265|       |
  266|  2.14k|  uint32_t num_encoded_vertices;
  267|  2.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.14k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 229, False: 1.91k]
  ------------------
  269|    229|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 229]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    229|  } else
  274|  1.91k|#endif
  275|  1.91k|  {
  276|  1.91k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 1.91k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  1.91k|  }
  280|  2.14k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.14k|  uint32_t num_faces;
  283|  2.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.14k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 229, False: 1.91k]
  ------------------
  285|    229|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 229]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    229|  } else
  290|  1.91k|#endif
  291|  1.91k|  {
  292|  1.91k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1.91k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  1.91k|  }
  296|  2.14k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 2, False: 2.14k]
  ------------------
  297|      2|    return false;  // Draco cannot handle this many faces.
  298|      2|  }
  299|       |
  300|  2.14k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 3, False: 2.13k]
  ------------------
  301|      3|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      3|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.13k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  2.13k|  const uint64_t num_encoded_vertices_64 =
  311|  2.13k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.13k|  const uint64_t max_num_vertex_edges =
  313|  2.13k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.13k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 5, False: 2.13k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      5|    return false;
  317|      5|  }
  318|       |
  319|  2.13k|  uint8_t num_attribute_data;
  320|  2.13k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.13k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.13k|  uint32_t num_encoded_symbols;
  325|  2.13k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.13k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.13k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 226, False: 1.90k]
  ------------------
  327|    226|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 226]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    226|  } else
  332|  1.90k|#endif
  333|  1.90k|  {
  334|  1.90k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 1.90k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  1.90k|  }
  338|       |
  339|  2.13k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 4, False: 2.12k]
  ------------------
  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|      4|    return false;
  344|      4|  }
  345|  2.12k|  const uint32_t max_encoded_faces =
  346|  2.12k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.12k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 8, False: 2.12k]
  ------------------
  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|      8|    return false;
  352|      8|  }
  353|       |
  354|  2.12k|  uint32_t num_encoded_split_symbols;
  355|  2.12k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.12k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.12k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 215, False: 1.90k]
  ------------------
  357|    215|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 215]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    215|  } else
  362|  1.90k|#endif
  363|  1.90k|  {
  364|  1.90k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 1.90k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  1.90k|  }
  368|       |
  369|  2.12k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 6, False: 2.11k]
  ------------------
  370|      6|    return false;  // Split symbols are a sub-set of all symbols.
  371|      6|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.11k|  vertex_traversal_length_.clear();
  375|  2.11k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.11k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.11k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.11k|  processed_corner_ids_.clear();
  380|  2.11k|  processed_corner_ids_.reserve(num_faces);
  381|  2.11k|  processed_connectivity_corners_.clear();
  382|  2.11k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.11k|  topology_split_data_.clear();
  384|  2.11k|  hole_event_data_.clear();
  385|  2.11k|  init_face_configurations_.clear();
  386|  2.11k|  init_corners_.clear();
  387|       |
  388|  2.11k|  last_symbol_id_ = -1;
  389|  2.11k|  last_face_id_ = -1;
  390|  2.11k|  last_vert_id_ = -1;
  391|       |
  392|  2.11k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.11k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.11k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.11k]
  ------------------
  397|  2.11k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      0|    return false;
  399|      0|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  2.11k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.11k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.11k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.11k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.11k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 301, False: 1.81k]
  ------------------
  411|    301|    uint32_t encoded_connectivity_size;
  412|    301|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    301|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 215, False: 86]
  ------------------
  413|    215|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 215]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|    215|    } else {
  417|     86|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 86]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|     86|    }
  421|    301|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 0, False: 301]
  ------------------
  422|    301|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 7, False: 294]
  ------------------
  423|      7|      return false;
  424|      7|    }
  425|    294|    DecoderBuffer event_buffer;
  426|    294|    event_buffer.Init(
  427|    294|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    294|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    294|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    294|    topology_split_decoded_bytes =
  432|    294|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    294|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 119, False: 175]
  ------------------
  434|    119|      return false;
  435|    119|    }
  436|       |
  437|    294|  } else
  438|  1.81k|#endif
  439|  1.81k|  {
  440|  1.81k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 15, False: 1.79k]
  ------------------
  441|     15|      return false;
  442|     15|    }
  443|  1.81k|  }
  444|       |
  445|  1.97k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.97k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.97k|                                           num_encoded_split_symbols);
  449|  1.97k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.97k|  DecoderBuffer traversal_end_buffer;
  452|  1.97k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 837, False: 1.13k]
  ------------------
  453|    837|    return false;
  454|    837|  }
  455|       |
  456|  1.13k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.13k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 944, False: 193]
  ------------------
  458|    944|    return false;
  459|    944|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    193|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    193|                           traversal_end_buffer.remaining_size(),
  464|    193|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    193|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    193|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    193|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 6, False: 187]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      6|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      6|  }
  471|    193|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    193|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 172, False: 21]
  ------------------
  475|    172|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    172|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    172|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 5, False: 167]
  ------------------
  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|    167|#endif
  485|    167|    {
  486|   310k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 310k, False: 167]
  ------------------
  487|   310k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 310k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   310k|      }
  491|    167|    }
  492|    172|  }
  493|    193|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    446|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 253, False: 193]
  ------------------
  498|    253|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   373k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 373k, False: 253]
  ------------------
  501|   373k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   373k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    253|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 253]
  ------------------
  505|    253|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    253|  }
  509|       |
  510|    193|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    446|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 253, False: 193]
  ------------------
  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|    253|    int32_t att_connectivity_verts =
  517|    253|        attribute_data_[i].connectivity_data.num_vertices();
  518|    253|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 6, False: 247]
  ------------------
  519|      6|      att_connectivity_verts = corner_table_->num_vertices();
  520|      6|    }
  521|    253|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    253|  }
  523|    193|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 18, False: 175]
  ------------------
  524|     18|    return false;
  525|     18|  }
  526|    175|  return true;
  527|    193|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     22|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     22|  return true;
  532|     22|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|  1.13k|    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.13k|  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.13k|  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.13k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.13k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.13k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.13k|  int num_faces = 0;
  562|  68.0M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 68.0M, False: 315]
  ------------------
  563|  68.0M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  68.0M|    bool check_topology_split = false;
  566|  68.0M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  68.0M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 4.78M, False: 63.2M]
  ------------------
  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.78M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 57, False: 4.78M]
  ------------------
  588|     57|        return -1;
  589|     57|      }
  590|       |
  591|  4.78M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  4.78M|      const VertexIndex vertex_x =
  593|  4.78M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  4.78M|      const CornerIndex corner_b =
  595|  4.78M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  4.78M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 375, False: 4.78M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    375|        return -1;
  600|    375|      }
  601|  4.78M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 4.78M]
  |  Branch (601:11): [True: 0, False: 4.78M]
  ------------------
  602|  4.78M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 4.78M]
  ------------------
  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.78M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  4.78M|      SetOppositeCorners(corner_a, corner + 1);
  612|  4.78M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  4.78M|      const VertexIndex vert_a_prev =
  616|  4.78M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  4.78M|      const VertexIndex vert_b_next =
  618|  4.78M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  4.78M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 4.78M]
  |  Branch (619:38): [True: 0, False: 4.78M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  4.78M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  4.78M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  4.78M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  4.78M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  4.78M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  4.78M|      active_corner_stack.back() = corner;
  631|  63.2M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 9.91k, False: 63.2M]
  |  Branch (631:40): [True: 54.4M, False: 8.76M]
  ------------------
  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|  54.4M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 54.4M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  54.4M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  54.4M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 54.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|  54.4M|      const CornerIndex corner(3 * face.value());
  658|  54.4M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  54.4M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 9.91k, False: 54.4M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  9.91k|        opp_corner = corner + 2;
  662|  9.91k|        corner_l = corner + 1;
  663|  9.91k|        corner_r = corner;
  664|  54.4M|      } else {
  665|       |        // "l" is the new first corner.
  666|  54.4M|        opp_corner = corner + 1;
  667|  54.4M|        corner_l = corner;
  668|  54.4M|        corner_r = corner + 2;
  669|  54.4M|      }
  670|  54.4M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  54.4M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  54.4M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 10, False: 54.4M]
  ------------------
  675|     10|        return -1;  // Unexpected number of decoded vertices.
  676|     10|      }
  677|       |
  678|  54.4M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  54.4M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  54.4M|      const VertexIndex vertex_r =
  682|  54.4M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  54.4M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  54.4M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  54.4M|      corner_table_->MapCornerToVertex(
  688|  54.4M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  54.4M|      active_corner_stack.back() = corner;
  690|  54.4M|      check_topology_split = true;
  691|  54.4M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 29.7k, False: 8.73M]
  ------------------
  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|  29.7k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 29.7k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  29.7k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  29.7k|      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|  29.7k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  29.7k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 20, False: 29.6k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     20|        active_corner_stack.push_back(it->second);
  714|     20|      }
  715|  29.7k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 69, False: 29.6k]
  ------------------
  716|     69|        return -1;
  717|     69|      }
  718|  29.6k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  29.6k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 29.6k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  29.6k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 2, False: 29.6k]
  |  Branch (724:11): [True: 2, False: 29.6k]
  ------------------
  725|  29.6k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 29.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|      2|        return -1;
  729|      2|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  29.6k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  29.6k|      SetOppositeCorners(corner_a, corner + 2);
  735|  29.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|  29.6k|      const VertexIndex vertex_p =
  739|  29.6k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  29.6k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  29.6k|      corner_table_->MapCornerToVertex(
  742|  29.6k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  29.6k|      const VertexIndex vert_b_prev =
  744|  29.6k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  29.6k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  29.6k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  29.6k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  29.6k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  29.6k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  29.6k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  29.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|  29.6k|      const CornerIndex first_corner = corner_n;
  757|  10.2M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 10.2M, False: 29.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|  29.6k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  29.6k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 29.5k, False: 99]
  ------------------
  770|  29.5k|        invalid_vertices.push_back(vertex_n);
  771|  29.5k|      }
  772|  29.6k|      active_corner_stack.back() = corner;
  773|  8.73M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 8.73M, False: 259]
  ------------------
  774|  8.73M|      const CornerIndex corner(3 * face.value());
  775|  8.73M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  8.73M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  8.73M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  8.73M|                                       corner_table_->AddNewVertex());
  780|  8.73M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  8.73M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  8.73M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 9, False: 8.73M]
  ------------------
  784|      9|        return -1;  // Unexpected number of decoded vertices.
  785|      9|      }
  786|       |
  787|  8.73M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  8.73M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  8.73M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  8.73M|      active_corner_stack.push_back(corner);
  792|  8.73M|      check_topology_split = true;
  793|  8.73M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    259|      return -1;
  796|    259|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  68.0M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  68.0M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 63.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|  63.2M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  63.2M|      EdgeFaceName split_edge;
  812|  63.2M|      int encoder_split_symbol_id;
  813|  63.2M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.05k, False: 63.2M]
  ------------------
  814|  63.2M|                             &encoder_split_symbol_id)) {
  815|  1.05k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 38, False: 1.01k]
  ------------------
  816|     38|          return -1;  // Wrong split symbol id.
  817|     38|        }
  818|       |        // Symbol was part of a topology split. Now we need to determine which
  819|       |        // edge should be added to the active edges stack.
  820|  1.01k|        const CornerIndex act_top_corner = active_corner_stack.back();
  821|       |        // The current symbol has one active edge (stored in act_top_corner) and
  822|       |        // two remaining inactive edges that are attached to it.
  823|       |        //              *
  824|       |        //             / \
  825|       |        //  left_edge /   \ right_edge
  826|       |        //           /     \
  827|       |        //          *.......*
  828|       |        //         active_edge
  829|       |
  830|  1.01k|        CornerIndex new_active_corner;
  831|  1.01k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 357, False: 662]
  ------------------
  832|    357|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    662|        } else {
  834|    662|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    662|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.01k|        const int decoder_split_symbol_id =
  839|  1.01k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.01k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.01k|            new_active_corner;
  842|  1.01k|      }
  843|  63.2M|    }
  844|  68.0M|  }
  845|    315|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 315]
  ------------------
  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.70M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 6.70M, False: 276]
  ------------------
  850|  6.70M|    const CornerIndex corner = active_corner_stack.back();
  851|  6.70M|    active_corner_stack.pop_back();
  852|  6.70M|    const bool interior_face =
  853|  6.70M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  6.70M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 4.44M, False: 2.25M]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  4.44M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 36, False: 4.44M]
  ------------------
  877|     36|        return -1;  // More faces than expected added to the mesh.
  878|     36|      }
  879|       |
  880|  4.44M|      const CornerIndex corner_a = corner;
  881|  4.44M|      const VertexIndex vert_n =
  882|  4.44M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  4.44M|      const CornerIndex corner_b =
  884|  4.44M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  4.44M|      const VertexIndex vert_x =
  887|  4.44M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  4.44M|      const CornerIndex corner_c =
  889|  4.44M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  4.44M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 4.44M]
  |  Branch (891:33): [True: 1, False: 4.44M]
  |  Branch (891:55): [True: 0, False: 4.44M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      3|        return -1;
  894|      3|      }
  895|  4.44M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 4.44M]
  |  Branch (895:11): [True: 0, False: 4.44M]
  ------------------
  896|  4.44M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 4.44M]
  ------------------
  897|  4.44M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 4.44M]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      0|        return -1;
  901|      0|      }
  902|       |
  903|  4.44M|      const VertexIndex vert_p =
  904|  4.44M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  4.44M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  4.44M|      const CornerIndex new_corner(3 * face.value());
  909|  4.44M|      SetOppositeCorners(new_corner, corner);
  910|  4.44M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  4.44M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  4.44M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  4.44M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  4.44M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  17.7M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 13.3M, False: 4.44M]
  ------------------
  920|  13.3M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  13.3M|      }
  922|       |
  923|  4.44M|      init_face_configurations_.push_back(true);
  924|  4.44M|      init_corners_.push_back(new_corner);
  925|  4.44M|    } 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|  2.25M|      init_face_configurations_.push_back(false);
  930|  2.25M|      init_corners_.push_back(corner);
  931|  2.25M|    }
  932|  6.70M|  }
  933|    276|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 80, False: 196]
  ------------------
  934|     80|    return -1;  // Unexpected number of decoded faces.
  935|     80|  }
  936|       |
  937|    196|  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.52k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 2.52k, False: 193]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  2.52k|    VertexIndex src_vert(num_vertices - 1);
  943|  3.16k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 642, False: 2.52k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    642|      src_vert = VertexIndex(--num_vertices - 1);
  946|    642|    }
  947|  2.52k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 470, False: 2.05k]
  ------------------
  948|    470|      continue;  // No need to swap anything.
  949|    470|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.05k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  8.27k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 6.22k, False: 2.04k]
  ------------------
  954|  6.22k|      const CornerIndex cid = vcit.Corner();
  955|  6.22k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 3, False: 6.21k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      3|        return -1;
  959|      3|      }
  960|  6.21k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  6.21k|    }
  962|  2.04k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  2.04k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  2.04k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  2.04k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  2.04k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  2.04k|    num_vertices--;
  972|  2.04k|  }
  973|    193|  return num_vertices;
  974|    196|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.10k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.10k|  uint32_t num_topology_splits;
  982|  2.10k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.10k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.10k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 209, False: 1.89k]
  ------------------
  984|    209|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 209]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|    209|  } else
  989|  1.89k|#endif
  990|  1.89k|  {
  991|  1.89k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 1.89k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  1.89k|  }
  995|  2.10k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 395, False: 1.71k]
  ------------------
  996|    395|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 22, False: 373]
  ------------------
  997|    395|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     22|      return -1;
  999|     22|    }
 1000|    373|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    373|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    373|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 63, False: 310]
  ------------------
 1002|   118k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 118k, False: 27]
  ------------------
 1003|   118k|        TopologySplitEventData event_data;
 1004|   118k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 21, False: 118k]
  ------------------
 1005|     21|          return -1;
 1006|     21|        }
 1007|   118k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 11, False: 118k]
  ------------------
 1008|     11|          return -1;
 1009|     11|        }
 1010|   118k|        uint8_t edge_data;
 1011|   118k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 118k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|   118k|        event_data.source_edge = edge_data & 1;
 1015|   118k|        topology_split_data_.push_back(event_data);
 1016|   118k|      }
 1017|       |
 1018|     63|    } else
 1019|    310|#endif
 1020|    310|    {
 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|    310|      int last_source_symbol_id = 0;
 1024|  6.45k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 6.15k, False: 299]
  ------------------
 1025|  6.15k|        TopologySplitEventData event_data;
 1026|  6.15k|        uint32_t delta;
 1027|  6.15k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 8, False: 6.14k]
  ------------------
 1028|      8|          return -1;
 1029|      8|        }
 1030|  6.14k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  6.14k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 3, False: 6.14k]
  ------------------
 1032|      3|          return -1;
 1033|      3|        }
 1034|  6.14k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 0, False: 6.14k]
  ------------------
 1035|      0|          return -1;
 1036|      0|        }
 1037|  6.14k|        event_data.split_symbol_id =
 1038|  6.14k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  6.14k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  6.14k|        topology_split_data_.push_back(event_data);
 1041|  6.14k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    299|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  2.90k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.60k, False: 299]
  ------------------
 1045|  2.60k|        uint32_t edge_data;
 1046|  2.60k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.60k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 242, False: 2.36k]
  ------------------
 1047|    242|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.36k|        } else {
 1049|  2.36k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.36k|        }
 1051|  2.60k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  2.60k|        event_data.source_edge = edge_data & 1;
 1053|  2.60k|      }
 1054|    299|      decoder_buffer->EndBitDecoding();
 1055|    299|    }
 1056|    373|  }
 1057|  2.03k|  uint32_t num_hole_events = 0;
 1058|  2.03k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.03k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.03k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 158, False: 1.88k]
  ------------------
 1060|    158|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 2, False: 156]
  ------------------
 1061|      2|      return -1;
 1062|      2|    }
 1063|  1.88k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.88k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 71, False: 1.81k]
  ------------------
 1064|     71|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 6, False: 65]
  ------------------
 1065|      6|      return -1;
 1066|      6|    }
 1067|     71|  }
 1068|  2.03k|#endif
 1069|  2.03k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 76, False: 1.95k]
  ------------------
 1070|     76|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     76|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     76|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 52, False: 24]
  ------------------
 1072|   113k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 113k, False: 7]
  ------------------
 1073|   113k|        HoleEventData event_data;
 1074|   113k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 45, False: 113k]
  ------------------
 1075|     45|          return -1;
 1076|     45|        }
 1077|   113k|        hole_event_data_.push_back(event_data);
 1078|   113k|      }
 1079|       |
 1080|     52|    } else
 1081|     24|#endif
 1082|     24|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     24|      int last_symbol_id = 0;
 1085|  91.6k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 91.6k, False: 12]
  ------------------
 1086|  91.6k|        HoleEventData event_data;
 1087|  91.6k|        uint32_t delta;
 1088|  91.6k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 12, False: 91.5k]
  ------------------
 1089|     12|          return -1;
 1090|     12|        }
 1091|  91.5k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  91.5k|        last_symbol_id = event_data.symbol_id;
 1093|  91.5k|        hole_event_data_.push_back(event_data);
 1094|  91.5k|      }
 1095|     24|    }
 1096|     76|  }
 1097|  1.97k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.03k|}
_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|   310k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   310k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   310k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   310k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.24M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 931k, False: 310k]
  ------------------
 1139|   931k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   931k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 181k, False: 749k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   363k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 181k, False: 181k]
  ------------------
 1144|   181k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   181k|      }
 1146|   181k|      continue;
 1147|   181k|    }
 1148|   749k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   749k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 374k, False: 374k]
  ------------------
 1151|   374k|      continue;
 1152|   374k|    }
 1153|       |
 1154|   749k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 374k, False: 374k]
  ------------------
 1155|   374k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   374k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 191k, False: 183k]
  ------------------
 1157|   191k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   191k|      }
 1159|   374k|    }
 1160|   374k|  }
 1161|   310k|  return true;
 1162|   310k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    193|    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|    193|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    193|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 21, False: 172]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  94.5k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 94.5k, False: 21]
  ------------------
 1176|  94.5k|      Mesh::Face face;
 1177|  94.5k|      const CornerIndex start_corner(3 * f.value());
 1178|   378k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 283k, False: 94.5k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   283k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   283k|        face[c] = vert_id;
 1182|   283k|      }
 1183|  94.5k|      decoder_->mesh()->SetFace(f, face);
 1184|  94.5k|    }
 1185|     21|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     21|    return true;
 1187|     21|  }
 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|    172|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    172|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   264k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 264k, False: 154]
  ------------------
 1197|   264k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   264k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 67, False: 264k]
  ------------------
 1199|     67|      continue;  // Isolated vertex.
 1200|     67|    }
 1201|   264k|    CornerIndex deduplication_first_corner = c;
 1202|   264k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 180k, False: 83.9k]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|   180k|      deduplication_first_corner = c;
 1206|   180k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  91.1k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 84.0k, False: 7.11k]
  ------------------
 1210|  84.0k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 6.94k, False: 77.0k]
  ------------------
 1211|  6.94k|          continue;  // No seam for this attribute, ignore it.
 1212|  6.94k|        }
 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|  77.0k|        const VertexIndex vert_id =
 1217|  77.0k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  77.0k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  77.0k|        bool seam_found = false;
 1220|  82.2k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 82.0k, False: 220]
  ------------------
 1221|  82.0k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 18, False: 82.0k]
  ------------------
 1222|     18|            return false;
 1223|     18|          }
 1224|  82.0k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 76.8k, False: 5.22k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  76.8k|            deduplication_first_corner = act_c;
 1227|  76.8k|            seam_found = true;
 1228|  76.8k|            break;
 1229|  76.8k|          }
 1230|  5.22k|          act_c = corner_table_->SwingRight(act_c);
 1231|  5.22k|        }
 1232|  77.0k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 76.8k, False: 220]
  ------------------
 1233|  76.8k|          break;  // No reason to process other attributes if we found a seam.
 1234|  76.8k|        }
 1235|  77.0k|      }
 1236|  83.9k|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|   264k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   264k|    corner_to_point_map[c.value()] =
 1246|   264k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   264k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   264k|    CornerIndex prev_c = c;
 1250|   264k|    c = corner_table_->SwingRight(c);
 1251|   885k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 704k, False: 180k]
  |  Branch (1251:40): [True: 620k, False: 83.4k]
  ------------------
 1252|   620k|      bool attribute_seam = false;
 1253|  1.08M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 621k, False: 468k]
  ------------------
 1254|   621k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 152k, False: 468k]
  ------------------
 1255|   621k|            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|   152k|          attribute_seam = true;
 1259|   152k|          break;
 1260|   152k|        }
 1261|   621k|      }
 1262|   620k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 152k, False: 468k]
  ------------------
 1263|   152k|        corner_to_point_map[c.value()] =
 1264|   152k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   152k|        point_to_corner_map.push_back(c.value());
 1266|   468k|      } else {
 1267|   468k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   468k|      }
 1269|   620k|      prev_c = c;
 1270|   620k|      c = corner_table_->SwingRight(c);
 1271|   620k|    }
 1272|   264k|  }
 1273|       |  // Add faces.
 1274|   124k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 124k, False: 154]
  ------------------
 1275|   124k|    Mesh::Face face;
 1276|   498k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 374k, False: 124k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   374k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   374k|    }
 1280|   124k|    decoder_->mesh()->SetFace(f, face);
 1281|   124k|  }
 1282|    154|  decoder_->point_cloud()->set_num_points(
 1283|    154|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    154|  return true;
 1285|    172|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    150|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    150|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    150|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    150|  const Mesh* mesh = decoder_->mesh();
  115|    150|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    150|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    150|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    150|                           encoding_data);
  120|       |
  121|    150|  TraverserT att_traverser;
  122|    150|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    150|  traversal_sequencer->SetTraverser(att_traverser);
  125|    150|  return std::move(traversal_sequencer);
  126|    150|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    943|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    943|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    943|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    943|  const Mesh* mesh = decoder_->mesh();
  115|    943|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    943|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    943|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    943|                           encoding_data);
  120|       |
  121|    943|  TraverserT att_traverser;
  122|    943|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    943|  traversal_sequencer->SetTraverser(att_traverser);
  125|    943|  return std::move(traversal_sequencer);
  126|    943|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    242|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    242|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    242|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    242|  const Mesh* mesh = decoder_->mesh();
  115|    242|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    242|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    242|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    242|                           encoding_data);
  120|       |
  121|    242|  TraverserT att_traverser;
  122|    242|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    242|  traversal_sequencer->SetTraverser(att_traverser);
  125|    242|  return std::move(traversal_sequencer);
  126|    242|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    877|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    877|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    877|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    877|  const Mesh* mesh = decoder_->mesh();
  115|    877|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    877|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    877|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    877|                           encoding_data);
  120|       |
  121|    877|  TraverserT att_traverser;
  122|    877|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    877|  traversal_sequencer->SetTraverser(att_traverser);
  125|    877|  return std::move(traversal_sequencer);
  126|    877|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     24|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|     24|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     24|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     24|  const Mesh* mesh = decoder_->mesh();
  115|     24|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     24|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     24|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     24|                           encoding_data);
  120|       |
  121|     24|  TraverserT att_traverser;
  122|     24|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     24|  traversal_sequencer->SetTraverser(att_traverser);
  125|     24|  return std::move(traversal_sequencer);
  126|     24|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     28|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|     28|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     28|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     28|  const Mesh* mesh = decoder_->mesh();
  115|     28|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     28|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     28|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     28|                           encoding_data);
  120|       |
  121|     28|  TraverserT att_traverser;
  122|     28|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     28|  traversal_sequencer->SetTraverser(att_traverser);
  125|     28|  return std::move(traversal_sequencer);
  126|     28|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  7.71k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  3.07k|  const CornerTable* GetCornerTable() const override {
   67|  3.07k|    return corner_table_.get();
   68|  3.07k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  5.29M|                       int* out_encoder_split_symbol_id) {
   87|  5.29M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 41.5k, False: 5.25M]
  ------------------
   88|  41.5k|      return false;
   89|  41.5k|    }
   90|  5.25M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 31, False: 5.25M]
  ------------------
   91|  5.25M|        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|     31|      *out_encoder_split_symbol_id = -1;
   98|     31|      return true;
   99|     31|    }
  100|  5.25M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 5.25M, False: 2.22k]
  ------------------
  101|  5.25M|      return false;
  102|  5.25M|    }
  103|  2.22k|    *out_face_edge =
  104|  2.22k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  2.22k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  2.22k|    topology_split_data_.pop_back();
  108|  2.22k|    return true;
  109|  5.25M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  13.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  13.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  13.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  13.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  7.98k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  7.27k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  4.98k|  const CornerTable* GetCornerTable() const override {
   67|  4.98k|    return corner_table_.get();
   68|  4.98k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  33.5M|                       int* out_encoder_split_symbol_id) {
   87|  33.5M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 33.4M, False: 69.4k]
  ------------------
   88|  33.4M|      return false;
   89|  33.4M|    }
   90|  69.4k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 21, False: 69.4k]
  ------------------
   91|  69.4k|        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|     21|      *out_encoder_split_symbol_id = -1;
   98|     21|      return true;
   99|     21|    }
  100|  69.4k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 67.9k, False: 1.44k]
  ------------------
  101|  67.9k|      return false;
  102|  67.9k|    }
  103|  1.44k|    *out_face_edge =
  104|  1.44k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.44k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.44k|    topology_split_data_.pop_back();
  108|  1.44k|    return true;
  109|  69.4k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  99.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  99.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  99.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  99.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  5.38k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  11.0k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.18k|  const CornerTable* GetCornerTable() const override {
   67|  2.18k|    return corner_table_.get();
   68|  2.18k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  63.2M|                       int* out_encoder_split_symbol_id) {
   87|  63.2M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 62.6M, False: 562k]
  ------------------
   88|  62.6M|      return false;
   89|  62.6M|    }
   90|   562k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 38, False: 562k]
  ------------------
   91|   562k|        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|     38|      *out_encoder_split_symbol_id = -1;
   98|     38|      return true;
   99|     38|    }
  100|   562k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 561k, False: 1.01k]
  ------------------
  101|   561k|      return false;
  102|   561k|    }
  103|  1.01k|    *out_face_edge =
  104|  1.01k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.01k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.01k|    topology_split_data_.pop_back();
  108|  1.01k|    return true;
  109|   562k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  77.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  77.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  77.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  77.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  4.45k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  7.50k|      : attribute_connectivity_decoders_(nullptr),
   34|  7.50k|        num_attribute_data_(0),
   35|  7.50k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  6.97k|  void Init(MeshEdgebreakerDecoderImplInterface* decoder) {
   37|  6.97k|    decoder_impl_ = decoder;
   38|  6.97k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  6.97k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  6.97k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  6.97k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  5.08k|  uint16_t BitstreamVersion() const {
   45|  5.08k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  5.08k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.57k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  6.97k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  4.99k|  bool Start(DecoderBuffer* out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  4.99k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 56, False: 4.94k]
  ------------------
   63|     56|      return false;
   64|     56|    }
   65|       |
   66|  4.94k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 90, False: 4.85k]
  ------------------
   67|     90|      return false;
   68|     90|    }
   69|       |
   70|  4.85k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 10, False: 4.84k]
  ------------------
   71|     10|      return false;
   72|     10|    }
   73|  4.84k|    *out_buffer = buffer_;
   74|  4.84k|    return true;
   75|  4.85k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  6.74M|  inline bool DecodeStartFaceConfiguration() {
   79|  6.74M|    uint32_t face_configuration;
   80|  6.74M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  6.74M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.74M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 596, False: 6.74M]
  ------------------
   82|    596|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    596|    } else
   85|  6.74M|#endif
   86|  6.74M|    {
   87|  6.74M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  6.74M|    }
   89|  6.74M|    return face_configuration;
   90|  6.74M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  10.5M|  inline uint32_t DecodeSymbol() {
   94|  10.5M|    uint32_t symbol;
   95|  10.5M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  10.5M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 4.24M, False: 6.33M]
  ------------------
   97|  4.24M|      return symbol;
   98|  4.24M|    }
   99|       |    // Else decode two additional bits.
  100|  6.33M|    uint32_t symbol_suffix;
  101|  6.33M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  6.33M|    symbol |= (symbol_suffix << 1);
  103|  6.33M|    return symbol;
  104|  10.5M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  10.4M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|   984k|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  24.0M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  24.0M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  24.0M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  4.62k|  void Done() {
  123|  4.62k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 4.43k, False: 187]
  ------------------
  124|  4.43k|      symbol_buffer_.EndBitDecoding();
  125|  4.43k|    }
  126|  4.62k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  4.62k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.62k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 311, False: 4.31k]
  ------------------
  128|    311|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    311|    } else
  131|  4.31k|#endif
  132|  4.31k|    {
  133|  4.31k|      start_face_decoder_.EndDecoding();
  134|  4.31k|    }
  135|  4.62k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  1.88k|  DecoderBuffer* buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  5.17k|  bool DecodeTraversalSymbols() {
  141|  5.17k|    uint64_t traversal_size;
  142|  5.17k|    symbol_buffer_ = buffer_;
  143|  5.17k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 12, False: 5.15k]
  ------------------
  144|     12|      return false;
  145|     12|    }
  146|  5.15k|    buffer_ = symbol_buffer_;
  147|  5.15k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 85, False: 5.07k]
  ------------------
  148|     85|      return false;
  149|     85|    }
  150|  5.07k|    buffer_.Advance(traversal_size);
  151|  5.07k|    return true;
  152|  5.15k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  6.87k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  6.87k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  6.87k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.87k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 537, False: 6.33k]
  ------------------
  158|    537|      start_face_buffer_ = buffer_;
  159|    537|      uint64_t traversal_size;
  160|    537|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 1, False: 536]
  ------------------
  161|      1|        return false;
  162|      1|      }
  163|    536|      buffer_ = start_face_buffer_;
  164|    536|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 123, False: 413]
  ------------------
  165|    123|        return false;
  166|    123|      }
  167|    413|      buffer_.Advance(traversal_size);
  168|    413|      return true;
  169|    536|    }
  170|  6.33k|#endif
  171|  6.33k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  6.87k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  6.73k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  6.73k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 4.78k, False: 1.94k]
  ------------------
  177|  4.78k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  4.78k|          new BinaryDecoder[num_attribute_data_]);
  179|  13.4k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 8.70k, False: 4.77k]
  ------------------
  180|  8.70k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 17, False: 8.68k]
  ------------------
  181|     17|          return false;
  182|     17|        }
  183|  8.70k|      }
  184|  4.78k|    }
  185|  6.72k|    return true;
  186|  6.73k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  2.23k|MeshSequentialDecoder::MeshSequentialDecoder() = default;
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  2.11k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  2.11k|  uint32_t num_faces;
   31|  2.11k|  uint32_t num_points;
   32|  2.11k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  2.11k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.11k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 347, False: 1.76k]
  ------------------
   34|    347|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 347]
  ------------------
   35|      0|      return false;
   36|      0|    }
   37|    347|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 347]
  ------------------
   38|      0|      return false;
   39|      0|    }
   40|       |
   41|    347|  } else
   42|  1.76k|#endif
   43|  1.76k|  {
   44|  1.76k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 0, False: 1.76k]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|  1.76k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 0, False: 1.76k]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|  1.76k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  2.11k|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|  2.11k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 0, False: 2.11k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|  2.11k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 4, False: 2.10k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|      4|    return false;
   62|      4|  }
   63|  2.10k|  uint8_t connectivity_method;
   64|  2.10k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 0, False: 2.10k]
  ------------------
   65|      0|    return false;
   66|      0|  }
   67|  2.10k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 1.68k, False: 428]
  ------------------
   68|  1.68k|    if (!DecodeAndDecompressIndices(num_faces, num_points)) {
  ------------------
  |  Branch (68:9): [True: 1.64k, False: 34]
  ------------------
   69|  1.64k|      return false;
   70|  1.64k|    }
   71|  1.68k|  } else {
   72|    428|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 302, False: 126]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|    812|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 515, False: 297]
  ------------------
   75|    515|        Mesh::Face face;
   76|  2.04k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 1.53k, False: 510]
  ------------------
   77|  1.53k|          uint8_t val;
   78|  1.53k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 1, False: 1.53k]
  ------------------
   79|      1|            return false;
   80|      1|          }
   81|  1.53k|          if (val >= num_points) {
  ------------------
  |  Branch (81:15): [True: 4, False: 1.53k]
  ------------------
   82|      4|            return false;
   83|      4|          }
   84|  1.53k|          face[j] = val;
   85|  1.53k|        }
   86|    510|        mesh()->AddFace(face);
   87|    510|      }
   88|    302|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (88:16): [True: 33, False: 93]
  ------------------
   89|       |      // Decode indices as uint16_t.
   90|    208|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:28): [True: 201, False: 7]
  ------------------
   91|    201|        Mesh::Face face;
   92|    737|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (92:25): [True: 562, False: 175]
  ------------------
   93|    562|          uint16_t val;
   94|    562|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (94:15): [True: 8, False: 554]
  ------------------
   95|      8|            return false;
   96|      8|          }
   97|    554|          if (val >= num_points) {
  ------------------
  |  Branch (97:15): [True: 18, False: 536]
  ------------------
   98|     18|            return false;
   99|     18|          }
  100|    536|          face[j] = val;
  101|    536|        }
  102|    175|        mesh()->AddFace(face);
  103|    175|      }
  104|     93|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (104:16): [True: 39, False: 54]
  ------------------
  105|     39|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     39|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (105:16): [True: 39, False: 0]
  ------------------
  106|       |      // Decode indices as uint32_t.
  107|    856|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (107:28): [True: 848, False: 8]
  ------------------
  108|    848|        Mesh::Face face;
  109|  3.32k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (109:25): [True: 2.51k, False: 817]
  ------------------
  110|  2.51k|          uint32_t val;
  111|  2.51k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (111:15): [True: 6, False: 2.50k]
  ------------------
  112|      6|            return false;
  113|      6|          }
  114|  2.50k|          if (val >= num_points) {
  ------------------
  |  Branch (114:15): [True: 25, False: 2.48k]
  ------------------
  115|     25|            return false;
  116|     25|          }
  117|  2.48k|          face[j] = val;
  118|  2.48k|        }
  119|    817|        mesh()->AddFace(face);
  120|    817|      }
  121|     54|    } else {
  122|       |      // Decode faces as uint32_t (default).
  123|    830|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (123:28): [True: 810, False: 20]
  ------------------
  124|    810|        Mesh::Face face;
  125|  3.17k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (125:25): [True: 2.39k, False: 776]
  ------------------
  126|  2.39k|          uint32_t val;
  127|  2.39k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (127:15): [True: 18, False: 2.37k]
  ------------------
  128|     18|            return false;
  129|     18|          }
  130|  2.37k|          if (val >= num_points) {
  ------------------
  |  Branch (130:15): [True: 16, False: 2.36k]
  ------------------
  131|     16|            return false;
  132|     16|          }
  133|  2.36k|          face[j] = val;
  134|  2.36k|        }
  135|    776|        mesh()->AddFace(face);
  136|    776|      }
  137|     54|    }
  138|    428|  }
  139|    366|  point_cloud()->set_num_points(num_points);
  140|    366|  return true;
  141|  2.10k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  143|  6.83k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  144|       |  // Always create the basic attribute decoder.
  145|  6.83k|  return SetAttributesDecoder(
  146|  6.83k|      att_decoder_id,
  147|  6.83k|      std::unique_ptr<AttributesDecoder>(
  148|  6.83k|          new SequentialAttributeDecodersController(
  149|  6.83k|              std::unique_ptr<PointsSequencer>(
  150|  6.83k|                  new LinearSequencer(point_cloud()->num_points())))));
  151|  6.83k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEjj:
  154|  1.68k|                                                       uint32_t num_points) {
  155|       |  // Get decoded indices differences that were encoded with an entropy code.
  156|  1.68k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  157|  1.68k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (157:7): [True: 1.52k, False: 157]
  ------------------
  158|  1.52k|    return false;
  159|  1.52k|  }
  160|       |  // Reconstruct the indices from the differences.
  161|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  162|    157|  int32_t last_index_value = 0;  // This will always be >= 0.
  163|    157|  int vertex_index = 0;
  164|    922|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (164:24): [True: 888, False: 34]
  ------------------
  165|    888|    Mesh::Face face;
  166|  3.29k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (166:21): [True: 2.53k, False: 765]
  ------------------
  167|  2.53k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  168|  2.53k|      int32_t index_diff = (encoded_val >> 1);
  169|  2.53k|      if (encoded_val & 1) {
  ------------------
  |  Branch (169:11): [True: 658, False: 1.87k]
  ------------------
  170|    658|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (170:13): [True: 36, False: 622]
  ------------------
  171|       |          // Subtracting index_diff would result in a negative index.
  172|     36|          return false;
  173|     36|        }
  174|    622|        index_diff = -index_diff;
  175|  1.87k|      } else {
  176|  1.87k|        if (index_diff >
  ------------------
  |  Branch (176:13): [True: 0, False: 1.87k]
  ------------------
  177|  1.87k|            (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|  1.87k|      }
  182|  2.49k|      const int32_t index_value = index_diff + last_index_value;
  183|  2.49k|      if (index_value < 0 || static_cast<uint32_t>(index_value) >= num_points) {
  ------------------
  |  Branch (183:11): [True: 0, False: 2.49k]
  |  Branch (183:30): [True: 87, False: 2.41k]
  ------------------
  184|     87|        return false;
  185|     87|      }
  186|  2.41k|      face[j] = index_value;
  187|  2.41k|      last_index_value = index_value;
  188|  2.41k|    }
  189|    765|    mesh()->AddFace(face);
  190|    765|  }
  191|     34|  return true;
  192|    157|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.80k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.97M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.97M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 3.97M, False: 5.74k]
  ------------------
   61|  3.97M|      return true;  // Already traversed.
   62|  3.97M|    }
   63|       |
   64|  5.74k|    corner_traversal_stack_.clear();
   65|  5.74k|    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|  5.74k|    const VertexIndex next_vert =
   69|  5.74k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  5.74k|    const VertexIndex prev_vert =
   71|  5.74k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  5.74k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 5.74k]
  |  Branch (72:45): [True: 0, False: 5.74k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  5.74k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 4.48k, False: 1.25k]
  ------------------
   76|  4.48k|      this->MarkVertexVisited(next_vert);
   77|  4.48k|      this->traversal_observer().OnNewVertexVisited(
   78|  4.48k|          next_vert, this->corner_table()->Next(corner_id));
   79|  4.48k|    }
   80|  5.74k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 4.74k, False: 1.00k]
  ------------------
   81|  4.74k|      this->MarkVertexVisited(prev_vert);
   82|  4.74k|      this->traversal_observer().OnNewVertexVisited(
   83|  4.74k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  4.74k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  34.4k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 28.6k, False: 5.74k]
  ------------------
   88|       |      // Currently processed corner.
   89|  28.6k|      corner_id = corner_traversal_stack_.back();
   90|  28.6k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  28.6k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 28.6k]
  |  Branch (92:47): [True: 1.16k, False: 27.5k]
  ------------------
   93|       |        // This face has been already traversed.
   94|  1.16k|        corner_traversal_stack_.pop_back();
   95|  1.16k|        continue;
   96|  1.16k|      }
   97|  3.97M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.97M, Folded]
  ------------------
   98|  3.97M|        this->MarkFaceVisited(face_id);
   99|  3.97M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.97M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.97M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.97M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.97M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 2.01M, False: 1.96M]
  ------------------
  105|  2.01M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  2.01M|          this->MarkVertexVisited(vert_id);
  107|  2.01M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  2.01M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.95M, False: 54.4k]
  ------------------
  109|  1.95M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.95M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.95M|            continue;
  112|  1.95M|          }
  113|  2.01M|        }
  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|  2.01M|        const CornerIndex right_corner_id =
  118|  2.01M|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.01M|        const CornerIndex left_corner_id =
  120|  2.01M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.01M|        const FaceIndex right_face_id(
  122|  2.01M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 38.8k, False: 1.97M]
  ------------------
  123|  2.01M|                 ? kInvalidFaceIndex
  124|  2.01M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.01M|        const FaceIndex left_face_id(
  126|  2.01M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 19.4k, False: 1.99M]
  ------------------
  127|  2.01M|                 ? kInvalidFaceIndex
  128|  2.01M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.01M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.96M, False: 54.3k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.96M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 16.0k, False: 1.94M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  16.0k|            corner_traversal_stack_.pop_back();
  134|  16.0k|            break;  // Break from the while (true) loop.
  135|  1.94M|          } else {
  136|       |            // Go to the left face.
  137|  1.94M|            corner_id = left_corner_id;
  138|  1.94M|            face_id = left_face_id;
  139|  1.94M|          }
  140|  1.96M|        } else {
  141|       |          // Right face was not visited.
  142|  54.3k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 42.8k, False: 11.4k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  42.8k|            corner_id = right_corner_id;
  145|  42.8k|            face_id = right_face_id;
  146|  42.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|  11.4k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  11.4k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  11.4k|            break;
  159|  11.4k|          }
  160|  54.3k|        }
  161|  2.01M|      }
  162|  27.5k|    }
  163|  5.74k|    return true;
  164|  5.74k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.80k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.69k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.98k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  5.35M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  5.35M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.16M, False: 4.19M]
  ------------------
   61|  1.16M|      return true;  // Already traversed.
   62|  1.16M|    }
   63|       |
   64|  4.19M|    corner_traversal_stack_.clear();
   65|  4.19M|    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.19M|    const VertexIndex next_vert =
   69|  4.19M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  4.19M|    const VertexIndex prev_vert =
   71|  4.19M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  4.19M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 4.19M]
  |  Branch (72:45): [True: 0, False: 4.19M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  4.19M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 4.18M, False: 1.21k]
  ------------------
   76|  4.18M|      this->MarkVertexVisited(next_vert);
   77|  4.18M|      this->traversal_observer().OnNewVertexVisited(
   78|  4.18M|          next_vert, this->corner_table()->Next(corner_id));
   79|  4.18M|    }
   80|  4.19M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 4.18M, False: 1.34k]
  ------------------
   81|  4.18M|      this->MarkVertexVisited(prev_vert);
   82|  4.18M|      this->traversal_observer().OnNewVertexVisited(
   83|  4.18M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  4.18M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  8.48M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 4.29M, False: 4.19M]
  ------------------
   88|       |      // Currently processed corner.
   89|  4.29M|      corner_id = corner_traversal_stack_.back();
   90|  4.29M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  4.29M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 4.29M]
  |  Branch (92:47): [True: 7.72k, False: 4.28M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  7.72k|        corner_traversal_stack_.pop_back();
   95|  7.72k|        continue;
   96|  7.72k|      }
   97|  5.35M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 5.35M, Folded]
  ------------------
   98|  5.35M|        this->MarkFaceVisited(face_id);
   99|  5.35M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  5.35M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  5.35M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 5.35M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  5.35M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 4.80M, False: 553k]
  ------------------
  105|  4.80M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  4.80M|          this->MarkVertexVisited(vert_id);
  107|  4.80M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  4.80M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 534k, False: 4.27M]
  ------------------
  109|   534k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   534k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   534k|            continue;
  112|   534k|          }
  113|  4.80M|        }
  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.82M|        const CornerIndex right_corner_id =
  118|  4.82M|            this->corner_table()->GetRightCorner(corner_id);
  119|  4.82M|        const CornerIndex left_corner_id =
  120|  4.82M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  4.82M|        const FaceIndex right_face_id(
  122|  4.82M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 4.23M, False: 590k]
  ------------------
  123|  4.82M|                 ? kInvalidFaceIndex
  124|  4.82M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  4.82M|        const FaceIndex left_face_id(
  126|  4.82M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 4.22M, False: 598k]
  ------------------
  127|  4.82M|                 ? kInvalidFaceIndex
  128|  4.82M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  4.82M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 4.74M, False: 76.8k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  4.74M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 4.23M, False: 515k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  4.23M|            corner_traversal_stack_.pop_back();
  134|  4.23M|            break;  // Break from the while (true) loop.
  135|  4.23M|          } else {
  136|       |            // Go to the left face.
  137|   515k|            corner_id = left_corner_id;
  138|   515k|            face_id = left_face_id;
  139|   515k|          }
  140|  4.74M|        } else {
  141|       |          // Right face was not visited.
  142|  76.8k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 26.5k, False: 50.3k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  26.5k|            corner_id = right_corner_id;
  145|  26.5k|            face_id = right_face_id;
  146|  50.3k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  50.3k|            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|  50.3k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  50.3k|            break;
  159|  50.3k|          }
  160|  76.8k|        }
  161|  4.82M|      }
  162|  4.28M|    }
  163|  4.19M|    return true;
  164|  4.19M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.98k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  4.05k|  DepthFirstTraverser() {}

_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   58|    395|  void OnTraversalStart() {
   59|    395|    prediction_degree_.resize(this->corner_table()->num_vertices(), 0);
   60|    395|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  3.10M|  bool TraverseFromCorner(CornerIndex corner_id) {
   66|  3.10M|    if (prediction_degree_.size() == 0) {
  ------------------
  |  Branch (66:9): [True: 0, False: 3.10M]
  ------------------
   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|  3.10M|    traversal_stacks_[0].push_back(corner_id);
   74|  3.10M|    best_priority_ = 0;
   75|       |    // For the first face, check the remaining corners as they may not be
   76|       |    // processed yet.
   77|  3.10M|    const VertexIndex next_vert =
   78|  3.10M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   79|  3.10M|    const VertexIndex prev_vert =
   80|  3.10M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   81|  3.10M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (81:9): [True: 1.42k, False: 3.10M]
  ------------------
   82|  1.42k|      this->MarkVertexVisited(next_vert);
   83|  1.42k|      this->traversal_observer().OnNewVertexVisited(
   84|  1.42k|          next_vert, this->corner_table()->Next(corner_id));
   85|  1.42k|    }
   86|  3.10M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (86:9): [True: 1.56k, False: 3.10M]
  ------------------
   87|  1.56k|      this->MarkVertexVisited(prev_vert);
   88|  1.56k|      this->traversal_observer().OnNewVertexVisited(
   89|  1.56k|          prev_vert, this->corner_table()->Previous(corner_id));
   90|  1.56k|    }
   91|  3.10M|    const VertexIndex tip_vertex = this->corner_table()->Vertex(corner_id);
   92|  3.10M|    if (!this->IsVertexVisited(tip_vertex)) {
  ------------------
  |  Branch (92:9): [True: 1.29k, False: 3.10M]
  ------------------
   93|  1.29k|      this->MarkVertexVisited(tip_vertex);
   94|  1.29k|      this->traversal_observer().OnNewVertexVisited(tip_vertex, corner_id);
   95|  1.29k|    }
   96|       |    // Start the actual traversal.
   97|  9.06M|    while ((corner_id = PopNextCornerToTraverse()) != kInvalidCornerIndex) {
  ------------------
  |  Branch (97:12): [True: 5.95M, False: 3.10M]
  ------------------
   98|  5.95M|      FaceIndex face_id(corner_id.value() / 3);
   99|       |      // Make sure the face hasn't been visited yet.
  100|  5.95M|      if (this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (100:11): [True: 4.63M, False: 1.32M]
  ------------------
  101|       |        // This face has been already traversed.
  102|  4.63M|        continue;
  103|  4.63M|      }
  104|       |
  105|  3.10M|      while (true) {
  ------------------
  |  Branch (105:14): [True: 3.10M, Folded]
  ------------------
  106|  3.10M|        face_id = FaceIndex(corner_id.value() / 3);
  107|  3.10M|        this->MarkFaceVisited(face_id);
  108|  3.10M|        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|  3.10M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  113|  3.10M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (113:13): [True: 1.57M, False: 1.53M]
  ------------------
  114|  1.57M|          this->MarkVertexVisited(vert_id);
  115|  1.57M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  116|  1.57M|        }
  117|       |
  118|       |        // Check whether we can traverse to the right and left neighboring
  119|       |        // faces.
  120|  3.10M|        const CornerIndex right_corner_id =
  121|  3.10M|            this->corner_table()->GetRightCorner(corner_id);
  122|  3.10M|        const CornerIndex left_corner_id =
  123|  3.10M|            this->corner_table()->GetLeftCorner(corner_id);
  124|  3.10M|        const FaceIndex right_face_id(
  125|  3.10M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (125:14): [True: 22.6k, False: 3.08M]
  ------------------
  126|  3.10M|                 ? kInvalidFaceIndex
  127|  3.10M|                 : FaceIndex(right_corner_id.value() / 3)));
  128|  3.10M|        const FaceIndex left_face_id(
  129|  3.10M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (129:14): [True: 24.7k, False: 3.08M]
  ------------------
  130|  3.10M|                 ? kInvalidFaceIndex
  131|  3.10M|                 : FaceIndex(left_corner_id.value() / 3)));
  132|  3.10M|        const bool is_right_face_visited = this->IsFaceVisited(right_face_id);
  133|  3.10M|        const bool is_left_face_visited = this->IsFaceVisited(left_face_id);
  134|       |
  135|  3.10M|        if (!is_left_face_visited) {
  ------------------
  |  Branch (135:13): [True: 2.42M, False: 683k]
  ------------------
  136|       |          // We can go to the left face.
  137|  2.42M|          const int priority = ComputePriority(left_corner_id);
  138|  2.42M|          if (is_right_face_visited && priority <= best_priority_) {
  ------------------
  |  Branch (138:15): [True: 885k, False: 1.53M]
  |  Branch (138:40): [True: 855k, False: 30.8k]
  ------------------
  139|       |            // Right face has been already visited and the priority is equal or
  140|       |            // better than the best priority. We are sure that the left face
  141|       |            // would be traversed next so there is no need to put it onto the
  142|       |            // stack.
  143|   855k|            corner_id = left_corner_id;
  144|   855k|            continue;
  145|  1.56M|          } else {
  146|  1.56M|            AddCornerToTraversalStack(left_corner_id, priority);
  147|  1.56M|          }
  148|  2.42M|        }
  149|  2.24M|        if (!is_right_face_visited) {
  ------------------
  |  Branch (149:13): [True: 2.21M, False: 38.9k]
  ------------------
  150|       |          // Go to the right face.
  151|  2.21M|          const int priority = ComputePriority(right_corner_id);
  152|  2.21M|          if (priority <= best_priority_) {
  ------------------
  |  Branch (152:15): [True: 927k, False: 1.28M]
  ------------------
  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|   927k|            corner_id = right_corner_id;
  156|   927k|            continue;
  157|  1.28M|          } else {
  158|  1.28M|            AddCornerToTraversalStack(right_corner_id, priority);
  159|  1.28M|          }
  160|  2.21M|        }
  161|       |
  162|       |        // Couldn't proceed directly to the next corner
  163|  1.32M|        break;
  164|  2.24M|      }
  165|  1.32M|    }
  166|  3.10M|    return true;
  167|  3.10M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE23PopNextCornerToTraverseEv:
  173|  9.06M|  CornerIndex PopNextCornerToTraverse() {
  174|  19.0M|    for (int i = best_priority_; i < kMaxPriority; ++i) {
  ------------------
  |  Branch (174:34): [True: 15.9M, False: 3.10M]
  ------------------
  175|  15.9M|      if (!traversal_stacks_[i].empty()) {
  ------------------
  |  Branch (175:11): [True: 5.95M, False: 9.97M]
  ------------------
  176|  5.95M|        const CornerIndex ret = traversal_stacks_[i].back();
  177|  5.95M|        traversal_stacks_[i].pop_back();
  178|  5.95M|        best_priority_ = i;
  179|  5.95M|        return ret;
  180|  5.95M|      }
  181|  15.9M|    }
  182|  3.10M|    return kInvalidCornerIndex;
  183|  9.06M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15ComputePriorityENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  194|  4.63M|  inline int ComputePriority(CornerIndex corner_id) {
  195|  4.63M|    const VertexIndex v_tip = this->corner_table()->Vertex(corner_id);
  196|       |    // Priority 0 when traversing to already visited vertices.
  197|  4.63M|    int priority = 0;
  198|  4.63M|    if (!this->IsVertexVisited(v_tip)) {
  ------------------
  |  Branch (198:9): [True: 3.09M, False: 1.53M]
  ------------------
  199|  3.09M|      const int degree = ++prediction_degree_[v_tip];
  200|       |      // Priority 1 when prediction degree > 1, otherwise 2.
  201|  3.09M|      priority = (degree > 1 ? 1 : 2);
  ------------------
  |  Branch (201:19): [True: 1.52M, False: 1.57M]
  ------------------
  202|  3.09M|    }
  203|       |    // Clamp the priority to the maximum number of buckets.
  204|  4.63M|    if (priority >= kMaxPriority) {
  ------------------
  |  Branch (204:9): [True: 0, False: 4.63M]
  ------------------
  205|      0|      priority = kMaxPriority - 1;
  206|      0|    }
  207|  4.63M|    return priority;
  208|  4.63M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE25AddCornerToTraversalStackENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEi:
  185|  2.85M|  inline void AddCornerToTraversalStack(CornerIndex ci, int priority) {
  186|  2.85M|    traversal_stacks_[priority].push_back(ci);
  187|       |    // Make sure that the best available priority is up to date.
  188|  2.85M|    if (priority < best_priority_) {
  ------------------
  |  Branch (188:9): [True: 658k, False: 2.19M]
  ------------------
  189|   658k|      best_priority_ = priority;
  190|   658k|    }
  191|  2.85M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   63|    395|  void OnTraversalEnd() {}
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   55|    832|  MaxPredictionDegreeTraverser() {}

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    416|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    931|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|    931|    const auto* corner_table = traverser_.corner_table();
   50|    931|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    931|    const size_t num_faces = mesh_->num_faces();
   52|    931|    const size_t num_points = mesh_->num_points();
   53|  5.53M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.53M, False: 931]
  ------------------
   54|  5.53M|      const auto& face = mesh_->face(f);
   55|  22.1M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 16.5M, False: 5.53M]
  ------------------
   56|  16.5M|        const PointIndex point_id = face[p];
   57|  16.5M|        const VertexIndex vert_id =
   58|  16.5M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  16.5M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 16.5M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  16.5M|        const AttributeValueIndex att_entry_id(
   63|  16.5M|            encoding_data_
   64|  16.5M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  16.5M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 16.5M]
  |  Branch (65:13): [True: 0, False: 16.5M]
  |  Branch (65:39): [True: 0, False: 16.5M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  16.5M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  16.5M|      }
   71|  5.53M|    }
   72|    931|    return true;
   73|    931|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    395|  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|    395|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    395|    traverser_.OnTraversalStart();
   82|    395|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 395]
  ------------------
   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|    395|    } else {
   89|    395|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.10M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.10M, False: 395]
  ------------------
   91|  3.10M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.10M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.10M|      }
   95|    395|    }
   96|    395|    traverser_.OnTraversalEnd();
   97|    395|    return true;
   98|    395|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.10M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.10M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.10M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    416|  void SetTraverser(const TraverserT& t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.84k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  8.25k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  8.25k|    const auto* corner_table = traverser_.corner_table();
   50|  8.25k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  8.25k|    const size_t num_faces = mesh_->num_faces();
   52|  8.25k|    const size_t num_points = mesh_->num_points();
   53|  6.18M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 6.17M, False: 8.25k]
  ------------------
   54|  6.17M|      const auto& face = mesh_->face(f);
   55|  24.6M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 18.5M, False: 6.17M]
  ------------------
   56|  18.5M|        const PointIndex point_id = face[p];
   57|  18.5M|        const VertexIndex vert_id =
   58|  18.5M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  18.5M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 18.5M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  18.5M|        const AttributeValueIndex att_entry_id(
   63|  18.5M|            encoding_data_
   64|  18.5M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  18.5M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 18.5M]
  |  Branch (65:13): [True: 0, False: 18.5M]
  |  Branch (65:39): [True: 0, False: 18.5M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  18.5M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  18.5M|      }
   71|  6.17M|    }
   72|  8.25k|    return true;
   73|  8.25k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.80k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  1.80k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.80k|    traverser_.OnTraversalStart();
   82|  1.80k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.80k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  1.80k|    } else {
   89|  1.80k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.97M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.97M, False: 1.80k]
  ------------------
   91|  3.97M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.97M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.97M|      }
   95|  1.80k|    }
   96|  1.80k|    traverser_.OnTraversalEnd();
   97|  1.80k|    return true;
   98|  1.80k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.97M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.97M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.97M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.84k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  2.02k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  9.65k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  9.65k|    const auto* corner_table = traverser_.corner_table();
   50|  9.65k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  9.65k|    const size_t num_faces = mesh_->num_faces();
   52|  9.65k|    const size_t num_points = mesh_->num_points();
   53|  9.07M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 9.06M, False: 9.65k]
  ------------------
   54|  9.06M|      const auto& face = mesh_->face(f);
   55|  36.2M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 27.2M, False: 9.06M]
  ------------------
   56|  27.2M|        const PointIndex point_id = face[p];
   57|  27.2M|        const VertexIndex vert_id =
   58|  27.2M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  27.2M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 27.2M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  27.2M|        const AttributeValueIndex att_entry_id(
   63|  27.2M|            encoding_data_
   64|  27.2M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  27.2M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 27.2M]
  |  Branch (65:13): [True: 1, False: 27.2M]
  |  Branch (65:39): [True: 1, False: 27.2M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      1|          return false;
   68|      1|        }
   69|  27.2M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  27.2M|      }
   71|  9.06M|    }
   72|  9.65k|    return true;
   73|  9.65k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.98k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  1.98k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.98k|    traverser_.OnTraversalStart();
   82|  1.98k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.98k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  1.98k|    } else {
   89|  1.98k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  5.36M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 5.35M, False: 1.98k]
  ------------------
   91|  5.35M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 5.35M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  5.35M|      }
   95|  1.98k|    }
   96|  1.98k|    traverser_.OnTraversalEnd();
   97|  1.98k|    return true;
   98|  1.98k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  5.35M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  5.35M|    return traverser_.TraverseFromCorner(corner_id);
  103|  5.35M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  2.02k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.05k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  41.5M|  inline const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  21.0M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  21.0M|    return is_vertex_visited_[vert_id.value()];
   65|  21.0M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  3.60M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  3.60M|    is_vertex_visited_[vert_id.value()] = true;
   68|  3.60M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  10.6M|  inline TraversalObserverT& traversal_observer() {
   75|  10.6M|    return traversal_observer_;
   76|  10.6M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  16.2M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  16.2M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 105k, False: 16.1M]
  ------------------
   47|   105k|      return true;  // Invalid faces are always considered as visited.
   48|   105k|    }
   49|  16.1M|    return is_face_visited_[face_id.value()];
   50|  16.2M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  7.08M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  7.08M|    is_face_visited_[face_id.value()] = true;
   62|  7.08M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.52k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.52k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.26k|                    TraversalObserver traversal_observer) {
   37|  2.26k|    corner_table_ = corner_table;
   38|  2.26k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.26k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.26k|    traversal_observer_ = traversal_observer;
   41|  2.26k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.97M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.97M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.97M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.97M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.97M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  45.5M|  inline const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  5.35M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  5.35M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 5.35M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  5.35M|    return is_face_visited_[corner_id.value() / 3];
   58|  5.35M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  13.7M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  13.7M|    return is_vertex_visited_[vert_id.value()];
   65|  13.7M|  }
_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.5M|  inline TraversalObserverT& traversal_observer() {
   75|  18.5M|    return traversal_observer_;
   76|  18.5M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  13.9M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  13.9M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 8.46M, False: 5.47M]
  ------------------
   47|  8.46M|      return true;  // Invalid faces are always considered as visited.
   48|  8.46M|    }
   49|  5.47M|    return is_face_visited_[face_id.value()];
   50|  13.9M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  5.35M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  5.35M|    is_face_visited_[face_id.value()] = true;
   62|  5.35M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.05k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.02k|                    TraversalObserver traversal_observer) {
   37|  2.02k|    corner_table_ = corner_table;
   38|  2.02k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.02k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.02k|    traversal_observer_ = traversal_observer;
   41|  2.02k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   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) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    230|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    230|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 15, False: 215]
  ------------------
  197|     15|    return false;
  198|     15|  }
  199|    215|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 23, False: 192]
  ------------------
  200|     23|    return false;
  201|     23|  }
  202|    192|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 4, False: 188]
  ------------------
  203|      4|    return false;
  204|      4|  }
  205|    188|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 77, False: 111]
  ------------------
  206|     77|    return true;
  207|     77|  }
  208|    111|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 31, False: 80]
  ------------------
  209|     31|    return false;
  210|     31|  }
  211|     80|  num_decoded_points_ = 0;
  212|       |
  213|     80|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 5, False: 75]
  ------------------
  214|      5|    return false;
  215|      5|  }
  216|     75|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 3, False: 72]
  ------------------
  217|      3|    return false;
  218|      3|  }
  219|     72|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 1, False: 71]
  ------------------
  220|      1|    return false;
  221|      1|  }
  222|     71|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 69]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     69|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 54, False: 15]
  ------------------
  227|     54|    return false;
  228|     54|  }
  229|       |
  230|     15|  numbers_decoder_.EndDecoding();
  231|     15|  remaining_bits_decoder_.EndDecoding();
  232|     15|  axis_decoder_.EndDecoding();
  233|     15|  half_decoder_.EndDecoding();
  234|       |
  235|     15|  return true;
  236|     69|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     69|    uint32_t num_points, OutputIteratorT& oit) {
  264|     69|  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|     69|  base_.assign(dimension_, 0);
  278|     69|  levels_.assign(dimension_, 0);
  279|     69|  undo_.clear();
  280|     69|  uint32_t depth = 0;
  281|     69|  DecodingStatus init_status(num_points, 0, 0);
  282|     69|  std::stack<Status> status_stack;
  283|     69|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  3.16M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 3.16M, False: 15]
  ------------------
  287|  3.16M|    const DecodingStatus status = status_stack.top();
  288|  3.16M|    status_stack.pop();
  289|       |
  290|  3.16M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  3.16M|    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.16M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 1.58M, False: 1.58M]
  ------------------
  295|  1.58M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 1.58M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  3.16M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 3.16M, False: 0]
  ------------------
  299|  3.16M|        const SplitUndo& split = undo_.back();
  300|  3.16M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 3.16M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  3.16M|        base_[split.axis] = split.old_base;
  304|  3.16M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 1.58M, False: 1.58M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  1.58M|          break;
  307|  1.58M|        }
  308|  1.58M|        levels_[split.axis] = split.old_level;
  309|  1.58M|        undo_.pop_back();
  310|  1.58M|      }
  311|  1.58M|      depth = status.depth;
  312|  1.58M|    }
  313|  3.16M|    const VectorUint32& old_base = base_;
  314|  3.16M|    const VectorUint32& levels = levels_;
  315|       |
  316|  3.16M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 3.16M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  3.16M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  3.16M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 3.16M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  3.16M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  3.16M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 1.58M, False: 1.58M]
  ------------------
  329|  11.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 9.69M, False: 1.58M]
  ------------------
  330|  9.69M|        *oit = old_base;
  331|  9.69M|        ++oit;
  332|  9.69M|        ++num_decoded_points_;
  333|  9.69M|      }
  334|  1.58M|      continue;
  335|  1.58M|    }
  336|       |
  337|  1.58M|    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.58M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 661, False: 1.58M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    661|      axes_[0] = axis;
  344|  1.76k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 1.10k, False: 661]
  ------------------
  345|  1.10k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.10k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 181, False: 919]
  |  |  ------------------
  ------------------
  346|  1.10k|      }
  347|  1.80k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.16k, False: 635]
  ------------------
  348|  3.79k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 2.65k, False: 1.14k]
  ------------------
  349|  2.65k|          p_[axes_[j]] = 0;
  350|  2.65k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  2.65k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 1.67k, False: 984]
  ------------------
  352|  1.67k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 26, False: 1.64k]
  ------------------
  353|  1.67k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     26|              return false;
  355|     26|            }
  356|  1.67k|          }
  357|  2.63k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  2.63k|        }
  359|  1.14k|        *oit = p_;
  360|  1.14k|        ++oit;
  361|  1.14k|        ++num_decoded_points_;
  362|  1.14k|      }
  363|    635|      continue;
  364|    661|    }
  365|       |
  366|  1.58M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1.58M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  1.58M|    const int num_remaining_bits = bit_length_ - level;
  371|  1.58M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  1.58M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  1.58M|    uint32_t number = 0;
  376|  1.58M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  1.58M|    uint32_t first_half = num_remaining_points / 2;
  379|  1.58M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 28, False: 1.58M]
  ------------------
  380|       |      // Invalid |number|.
  381|     28|      return false;
  382|     28|    }
  383|  1.58M|    first_half -= number;
  384|  1.58M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  1.58M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 854k, False: 729k]
  ------------------
  387|   854k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 852k, False: 1.80k]
  ------------------
  388|   852k|        std::swap(first_half, second_half);
  389|   852k|      }
  390|   854k|    }
  391|       |
  392|  1.58M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 1.58M]
  ------------------
  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.58M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  1.58M|    levels_[axis] += 1;
  400|  1.58M|    base_[axis] += modifier;
  401|  1.58M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 1.58M, False: 30]
  ------------------
  402|  1.58M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  1.58M|    }
  404|  1.58M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 1.58M, False: 50]
  ------------------
  405|  1.58M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  1.58M|    }
  407|  1.58M|    ++depth;
  408|  1.58M|  }
  409|     15|  return true;
  410|     69|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  130|  4.51M|        : num_remaining_points(num_remaining_points_),
  131|  4.51M|          last_axis(last_axis_),
  132|  4.51M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  123|  2.25M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  2.25M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  2.25M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  114|     92|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    301|      : bit_length_(0),
   87|    301|        num_points_(0),
   88|    301|        num_decoded_points_(0),
   89|    301|        dimension_(dimension),
   90|    301|        p_(dimension, 0),
   91|    301|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    191|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    191|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 5, False: 186]
  ------------------
  197|      5|    return false;
  198|      5|  }
  199|    186|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 22, False: 164]
  ------------------
  200|     22|    return false;
  201|     22|  }
  202|    164|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 0, False: 164]
  ------------------
  203|      0|    return false;
  204|      0|  }
  205|    164|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 38, False: 126]
  ------------------
  206|     38|    return true;
  207|     38|  }
  208|    126|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 32, False: 94]
  ------------------
  209|     32|    return false;
  210|     32|  }
  211|     94|  num_decoded_points_ = 0;
  212|       |
  213|     94|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 16, False: 78]
  ------------------
  214|     16|    return false;
  215|     16|  }
  216|     78|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 3, False: 75]
  ------------------
  217|      3|    return false;
  218|      3|  }
  219|     75|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 2, False: 73]
  ------------------
  220|      2|    return false;
  221|      2|  }
  222|     73|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 71]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     71|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 48, False: 23]
  ------------------
  227|     48|    return false;
  228|     48|  }
  229|       |
  230|     23|  numbers_decoder_.EndDecoding();
  231|     23|  remaining_bits_decoder_.EndDecoding();
  232|     23|  axis_decoder_.EndDecoding();
  233|     23|  half_decoder_.EndDecoding();
  234|       |
  235|     23|  return true;
  236|     71|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     71|    uint32_t num_points, OutputIteratorT& oit) {
  264|     71|  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|     71|  base_.assign(dimension_, 0);
  278|     71|  levels_.assign(dimension_, 0);
  279|     71|  undo_.clear();
  280|     71|  uint32_t depth = 0;
  281|     71|  DecodingStatus init_status(num_points, 0, 0);
  282|     71|  std::stack<Status> status_stack;
  283|     71|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  9.58M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 9.58M, False: 23]
  ------------------
  287|  9.58M|    const DecodingStatus status = status_stack.top();
  288|  9.58M|    status_stack.pop();
  289|       |
  290|  9.58M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  9.58M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  9.58M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 4.79M, False: 4.79M]
  ------------------
  295|  4.79M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 4.79M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  9.58M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 9.58M, False: 0]
  ------------------
  299|  9.58M|        const SplitUndo& split = undo_.back();
  300|  9.58M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 9.58M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  9.58M|        base_[split.axis] = split.old_base;
  304|  9.58M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 4.79M, False: 4.78M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  4.79M|          break;
  307|  4.79M|        }
  308|  4.78M|        levels_[split.axis] = split.old_level;
  309|  4.78M|        undo_.pop_back();
  310|  4.78M|      }
  311|  4.79M|      depth = status.depth;
  312|  4.79M|    }
  313|  9.58M|    const VectorUint32& old_base = base_;
  314|  9.58M|    const VectorUint32& levels = levels_;
  315|       |
  316|  9.58M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 9.58M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  9.58M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  9.58M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 9.58M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  9.58M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  9.58M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 4.78M, False: 4.79M]
  ------------------
  329|  18.4M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 13.6M, False: 4.78M]
  ------------------
  330|  13.6M|        *oit = old_base;
  331|  13.6M|        ++oit;
  332|  13.6M|        ++num_decoded_points_;
  333|  13.6M|      }
  334|  4.78M|      continue;
  335|  4.78M|    }
  336|       |
  337|  4.79M|    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.79M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 626, False: 4.79M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    626|      axes_[0] = axis;
  344|  3.67k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 3.04k, False: 626]
  ------------------
  345|  3.04k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  3.04k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 189, False: 2.85k]
  |  |  ------------------
  ------------------
  346|  3.04k|      }
  347|  1.70k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.10k, False: 595]
  ------------------
  348|  5.61k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 4.54k, False: 1.07k]
  ------------------
  349|  4.54k|          p_[axes_[j]] = 0;
  350|  4.54k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  4.54k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 1.90k, False: 2.63k]
  ------------------
  352|  1.90k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 31, False: 1.87k]
  ------------------
  353|  1.90k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     31|              return false;
  355|     31|            }
  356|  1.90k|          }
  357|  4.50k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  4.50k|        }
  359|  1.07k|        *oit = p_;
  360|  1.07k|        ++oit;
  361|  1.07k|        ++num_decoded_points_;
  362|  1.07k|      }
  363|    595|      continue;
  364|    626|    }
  365|       |
  366|  4.79M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 4.79M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  4.79M|    const int num_remaining_bits = bit_length_ - level;
  371|  4.79M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  4.79M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  4.79M|    uint32_t number = 0;
  376|  4.79M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  4.79M|    uint32_t first_half = num_remaining_points / 2;
  379|  4.79M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 17, False: 4.79M]
  ------------------
  380|       |      // Invalid |number|.
  381|     17|      return false;
  382|     17|    }
  383|  4.79M|    first_half -= number;
  384|  4.79M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  4.79M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 2.85M, False: 1.94M]
  ------------------
  387|  2.85M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 2.84M, False: 3.03k]
  ------------------
  388|  2.84M|        std::swap(first_half, second_half);
  389|  2.84M|      }
  390|  2.85M|    }
  391|       |
  392|  4.79M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 4.79M]
  ------------------
  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.79M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  4.79M|    levels_[axis] += 1;
  400|  4.79M|    base_[axis] += modifier;
  401|  4.79M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 4.79M, False: 22]
  ------------------
  402|  4.79M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  4.79M|    }
  404|  4.79M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 4.79M, False: 44]
  ------------------
  405|  4.79M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  4.79M|    }
  407|  4.79M|    ++depth;
  408|  4.79M|  }
  409|     23|  return true;
  410|     71|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  130|  11.4M|        : num_remaining_points(num_remaining_points_),
  131|  11.4M|          last_axis(last_axis_),
  132|  11.4M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  11.4M|    uint32_t last_axis) {
  242|  11.4M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 11.4M, Folded]
  ------------------
  243|  11.4M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  11.4M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 10.0M, False: 1.46M]
  |  |  ------------------
  ------------------
  244|  11.4M|  }
  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|  11.4M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  123|  5.74M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  5.74M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  5.74M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  114|     61|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    275|      : bit_length_(0),
   87|    275|        num_points_(0),
   88|    275|        num_decoded_points_(0),
   89|    275|        dimension_(dimension),
   90|    275|        p_(dimension, 0),
   91|    275|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    140|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    140|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 0, False: 140]
  ------------------
  197|      0|    return false;
  198|      0|  }
  199|    140|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 19, False: 121]
  ------------------
  200|     19|    return false;
  201|     19|  }
  202|    121|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 0, False: 121]
  ------------------
  203|      0|    return false;
  204|      0|  }
  205|    121|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 17, False: 104]
  ------------------
  206|     17|    return true;
  207|     17|  }
  208|    104|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 14, False: 90]
  ------------------
  209|     14|    return false;
  210|     14|  }
  211|     90|  num_decoded_points_ = 0;
  212|       |
  213|     90|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 3, False: 87]
  ------------------
  214|      3|    return false;
  215|      3|  }
  216|     87|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 3, False: 84]
  ------------------
  217|      3|    return false;
  218|      3|  }
  219|     84|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 7, False: 77]
  ------------------
  220|      7|    return false;
  221|      7|  }
  222|     77|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 5, False: 72]
  ------------------
  223|      5|    return false;
  224|      5|  }
  225|       |
  226|     72|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 63, False: 9]
  ------------------
  227|     63|    return false;
  228|     63|  }
  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|     72|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  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|  45.9k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 45.9k, False: 9]
  ------------------
  287|  45.9k|    const DecodingStatus status = status_stack.top();
  288|  45.9k|    status_stack.pop();
  289|       |
  290|  45.9k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  45.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|  45.9k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 40.0k, False: 5.94k]
  ------------------
  295|  40.0k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 40.0k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  84.6k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 84.6k, False: 0]
  ------------------
  299|  84.6k|        const SplitUndo& split = undo_.back();
  300|  84.6k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 84.6k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  84.6k|        base_[split.axis] = split.old_base;
  304|  84.6k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 40.0k, False: 44.6k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  40.0k|          break;
  307|  40.0k|        }
  308|  44.6k|        levels_[split.axis] = split.old_level;
  309|  44.6k|        undo_.pop_back();
  310|  44.6k|      }
  311|  40.0k|      depth = status.depth;
  312|  40.0k|    }
  313|  45.9k|    const VectorUint32& old_base = base_;
  314|  45.9k|    const VectorUint32& levels = levels_;
  315|       |
  316|  45.9k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 45.9k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  45.9k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  45.9k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 45.9k]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  45.9k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  45.9k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 523, False: 45.4k]
  ------------------
  329|  1.21M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 1.21M, False: 523]
  ------------------
  330|  1.21M|        *oit = old_base;
  331|  1.21M|        ++oit;
  332|  1.21M|        ++num_decoded_points_;
  333|  1.21M|      }
  334|    523|      continue;
  335|    523|    }
  336|       |
  337|  45.4k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  45.4k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 218, False: 45.2k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    218|      axes_[0] = axis;
  344|    961|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 743, False: 218]
  ------------------
  345|    743|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    743|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 56, False: 687]
  |  |  ------------------
  ------------------
  346|    743|      }
  347|    566|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 366, False: 200]
  ------------------
  348|  1.02k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 677, False: 348]
  ------------------
  349|    677|          p_[axes_[j]] = 0;
  350|    677|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|    677|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 618, False: 59]
  ------------------
  352|    618|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 18, False: 600]
  ------------------
  353|    618|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     18|              return false;
  355|     18|            }
  356|    618|          }
  357|    659|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|    659|        }
  359|    348|        *oit = p_;
  360|    348|        ++oit;
  361|    348|        ++num_decoded_points_;
  362|    348|      }
  363|    200|      continue;
  364|    218|    }
  365|       |
  366|  45.2k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 45.2k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  45.2k|    const int num_remaining_bits = bit_length_ - level;
  371|  45.2k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  45.2k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  45.2k|    uint32_t number = 0;
  376|  45.2k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  45.2k|    uint32_t first_half = num_remaining_points / 2;
  379|  45.2k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 45, False: 45.1k]
  ------------------
  380|       |      // Invalid |number|.
  381|     45|      return false;
  382|     45|    }
  383|  45.1k|    first_half -= number;
  384|  45.1k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  45.1k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 44.8k, False: 353]
  ------------------
  387|  44.8k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 39.8k, False: 5.00k]
  ------------------
  388|  39.8k|        std::swap(first_half, second_half);
  389|  39.8k|      }
  390|  44.8k|    }
  391|       |
  392|  45.1k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 45.1k]
  ------------------
  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|  45.1k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  45.1k|    levels_[axis] += 1;
  400|  45.1k|    base_[axis] += modifier;
  401|  45.1k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 40.4k, False: 4.74k]
  ------------------
  402|  40.4k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  40.4k|    }
  404|  45.1k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 5.87k, False: 39.3k]
  ------------------
  405|  5.87k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  5.87k|    }
  407|  45.1k|    ++depth;
  408|  45.1k|  }
  409|      9|  return true;
  410|     72|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  130|  73.1k|        : num_remaining_points(num_remaining_points_),
  131|  73.1k|          last_axis(last_axis_),
  132|  73.1k|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  123|  58.7k|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  58.7k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  58.7k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  114|     26|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    231|      : bit_length_(0),
   87|    231|        num_points_(0),
   88|    231|        num_decoded_points_(0),
   89|    231|        dimension_(dimension),
   90|    231|        p_(dimension, 0),
   91|    231|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    107|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    107|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 1, False: 106]
  ------------------
  197|      1|    return false;
  198|      1|  }
  199|    106|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 7, False: 99]
  ------------------
  200|      7|    return false;
  201|      7|  }
  202|     99|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 0, False: 99]
  ------------------
  203|      0|    return false;
  204|      0|  }
  205|     99|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 17, False: 82]
  ------------------
  206|     17|    return true;
  207|     17|  }
  208|     82|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 3, False: 79]
  ------------------
  209|      3|    return false;
  210|      3|  }
  211|     79|  num_decoded_points_ = 0;
  212|       |
  213|     79|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 0, False: 79]
  ------------------
  214|      0|    return false;
  215|      0|  }
  216|     79|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 4, False: 75]
  ------------------
  217|      4|    return false;
  218|      4|  }
  219|     75|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 6, False: 69]
  ------------------
  220|      6|    return false;
  221|      6|  }
  222|     69|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 67]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     67|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 63, False: 4]
  ------------------
  227|     63|    return false;
  228|     63|  }
  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|     67|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     67|    uint32_t num_points, OutputIteratorT& oit) {
  264|     67|  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|     67|  base_.assign(dimension_, 0);
  278|     67|  levels_.assign(dimension_, 0);
  279|     67|  undo_.clear();
  280|     67|  uint32_t depth = 0;
  281|     67|  DecodingStatus init_status(num_points, 0, 0);
  282|     67|  std::stack<Status> status_stack;
  283|     67|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  21.4k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 21.4k, False: 4]
  ------------------
  287|  21.4k|    const DecodingStatus status = status_stack.top();
  288|  21.4k|    status_stack.pop();
  289|       |
  290|  21.4k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  21.4k|    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|  21.4k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 16.2k, False: 5.18k]
  ------------------
  295|  16.2k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 16.2k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  36.0k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 36.0k, False: 0]
  ------------------
  299|  36.0k|        const SplitUndo& split = undo_.back();
  300|  36.0k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 36.0k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  36.0k|        base_[split.axis] = split.old_base;
  304|  36.0k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 16.2k, False: 19.7k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  16.2k|          break;
  307|  16.2k|        }
  308|  19.7k|        levels_[split.axis] = split.old_level;
  309|  19.7k|        undo_.pop_back();
  310|  19.7k|      }
  311|  16.2k|      depth = status.depth;
  312|  16.2k|    }
  313|  21.4k|    const VectorUint32& old_base = base_;
  314|  21.4k|    const VectorUint32& levels = levels_;
  315|       |
  316|  21.4k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 21.4k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  21.4k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  21.4k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 21.4k]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  21.4k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  21.4k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 919, False: 20.5k]
  ------------------
  329|   474k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 473k, False: 919]
  ------------------
  330|   473k|        *oit = old_base;
  331|   473k|        ++oit;
  332|   473k|        ++num_decoded_points_;
  333|   473k|      }
  334|    919|      continue;
  335|    919|    }
  336|       |
  337|  20.5k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  20.5k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 347, False: 20.2k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    347|      axes_[0] = axis;
  344|  2.32k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 1.97k, False: 347]
  ------------------
  345|  1.97k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.97k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 88, False: 1.88k]
  |  |  ------------------
  ------------------
  346|  1.97k|      }
  347|    926|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 590, False: 336]
  ------------------
  348|  4.34k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 3.76k, False: 579]
  ------------------
  349|  3.76k|          p_[axes_[j]] = 0;
  350|  3.76k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  3.76k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 783, False: 2.98k]
  ------------------
  352|    783|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 11, False: 772]
  ------------------
  353|    783|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     11|              return false;
  355|     11|            }
  356|    783|          }
  357|  3.75k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  3.75k|        }
  359|    579|        *oit = p_;
  360|    579|        ++oit;
  361|    579|        ++num_decoded_points_;
  362|    579|      }
  363|    336|      continue;
  364|    347|    }
  365|       |
  366|  20.2k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 20.2k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  20.2k|    const int num_remaining_bits = bit_length_ - level;
  371|  20.2k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  20.2k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  20.2k|    uint32_t number = 0;
  376|  20.2k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  20.2k|    uint32_t first_half = num_remaining_points / 2;
  379|  20.2k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 52, False: 20.1k]
  ------------------
  380|       |      // Invalid |number|.
  381|     52|      return false;
  382|     52|    }
  383|  20.1k|    first_half -= number;
  384|  20.1k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  20.1k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 19.4k, False: 705]
  ------------------
  387|  19.4k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 15.4k, False: 3.99k]
  ------------------
  388|  15.4k|        std::swap(first_half, second_half);
  389|  15.4k|      }
  390|  19.4k|    }
  391|       |
  392|  20.1k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 20.1k]
  ------------------
  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|  20.1k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  20.1k|    levels_[axis] += 1;
  400|  20.1k|    base_[axis] += modifier;
  401|  20.1k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 16.5k, False: 3.55k]
  ------------------
  402|  16.5k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  16.5k|    }
  404|  20.1k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 5.12k, False: 15.0k]
  ------------------
  405|  5.12k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  5.12k|    }
  407|  20.1k|    ++depth;
  408|  20.1k|  }
  409|      4|  return true;
  410|     67|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  130|  4.23M|        : num_remaining_points(num_remaining_points_),
  131|  4.23M|          last_axis(last_axis_),
  132|  4.23M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  4.23M|    uint32_t last_axis) {
  242|  4.23M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 4.23M, Folded]
  ------------------
  243|  4.23M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.23M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.20M, False: 3.02M]
  |  |  ------------------
  ------------------
  244|  4.23M|  }
  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.23M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  123|  2.12M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  2.12M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  2.12M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  114|     21|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    243|      : bit_length_(0),
   87|    243|        num_points_(0),
   88|    243|        num_decoded_points_(0),
   89|    243|        dimension_(dimension),
   90|    243|        p_(dimension, 0),
   91|    243|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    191|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    191|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 0, False: 191]
  ------------------
  197|      0|    return false;
  198|      0|  }
  199|    191|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 15, False: 176]
  ------------------
  200|     15|    return false;
  201|     15|  }
  202|    176|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 0, False: 176]
  ------------------
  203|      0|    return false;
  204|      0|  }
  205|    176|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 19, False: 157]
  ------------------
  206|     19|    return true;
  207|     19|  }
  208|    157|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 16, False: 141]
  ------------------
  209|     16|    return false;
  210|     16|  }
  211|    141|  num_decoded_points_ = 0;
  212|       |
  213|    141|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 18, False: 123]
  ------------------
  214|     18|    return false;
  215|     18|  }
  216|    123|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 3, False: 120]
  ------------------
  217|      3|    return false;
  218|      3|  }
  219|    120|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 2, False: 118]
  ------------------
  220|      2|    return false;
  221|      2|  }
  222|    118|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 116]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|    116|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 42, False: 74]
  ------------------
  227|     42|    return false;
  228|     42|  }
  229|       |
  230|     74|  numbers_decoder_.EndDecoding();
  231|     74|  remaining_bits_decoder_.EndDecoding();
  232|     74|  axis_decoder_.EndDecoding();
  233|     74|  half_decoder_.EndDecoding();
  234|       |
  235|     74|  return true;
  236|    116|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|    116|    uint32_t num_points, OutputIteratorT& oit) {
  264|    116|  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|    116|  base_.assign(dimension_, 0);
  278|    116|  levels_.assign(dimension_, 0);
  279|    116|  undo_.clear();
  280|    116|  uint32_t depth = 0;
  281|    116|  DecodingStatus init_status(num_points, 0, 0);
  282|    116|  std::stack<Status> status_stack;
  283|    116|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  1.94M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 1.94M, False: 74]
  ------------------
  287|  1.94M|    const DecodingStatus status = status_stack.top();
  288|  1.94M|    status_stack.pop();
  289|       |
  290|  1.94M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  1.94M|    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.94M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 976k, False: 970k]
  ------------------
  295|   976k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 976k]
  ------------------
  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: 976k, False: 978k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|   976k|          break;
  307|   976k|        }
  308|   978k|        levels_[split.axis] = split.old_level;
  309|   978k|        undo_.pop_back();
  310|   978k|      }
  311|   976k|      depth = status.depth;
  312|   976k|    }
  313|  1.94M|    const VectorUint32& old_base = base_;
  314|  1.94M|    const VectorUint32& levels = levels_;
  315|       |
  316|  1.94M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 1.94M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  1.94M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  1.94M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 1.94M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  1.94M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  1.94M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 880k, False: 1.06M]
  ------------------
  329|   114M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 113M, False: 880k]
  ------------------
  330|   113M|        *oit = old_base;
  331|   113M|        ++oit;
  332|   113M|        ++num_decoded_points_;
  333|   113M|      }
  334|   880k|      continue;
  335|   880k|    }
  336|       |
  337|  1.06M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  1.06M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 78.4k, False: 987k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|  78.4k|      axes_[0] = axis;
  344|   131k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 53.0k, False: 78.4k]
  ------------------
  345|  53.0k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  53.0k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 16.5k, False: 36.5k]
  |  |  ------------------
  ------------------
  346|  53.0k|      }
  347|   198k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 119k, False: 78.3k]
  ------------------
  348|   312k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 192k, False: 119k]
  ------------------
  349|   192k|          p_[axes_[j]] = 0;
  350|   192k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|   192k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 160k, False: 32.2k]
  ------------------
  352|   160k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 36, False: 160k]
  ------------------
  353|   160k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     36|              return false;
  355|     36|            }
  356|   160k|          }
  357|   192k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|   192k|        }
  359|   119k|        *oit = p_;
  360|   119k|        ++oit;
  361|   119k|        ++num_decoded_points_;
  362|   119k|      }
  363|  78.3k|      continue;
  364|  78.4k|    }
  365|       |
  366|   987k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 987k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|   987k|    const int num_remaining_bits = bit_length_ - level;
  371|   987k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|   987k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|   987k|    uint32_t number = 0;
  376|   987k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|   987k|    uint32_t first_half = num_remaining_points / 2;
  379|   987k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 6, False: 987k]
  ------------------
  380|       |      // Invalid |number|.
  381|      6|      return false;
  382|      6|    }
  383|   987k|    first_half -= number;
  384|   987k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|   987k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 939k, False: 48.4k]
  ------------------
  387|   939k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 889k, False: 49.8k]
  ------------------
  388|   889k|        std::swap(first_half, second_half);
  389|   889k|      }
  390|   939k|    }
  391|       |
  392|   987k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 987k]
  ------------------
  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|   987k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|   987k|    levels_[axis] += 1;
  400|   987k|    base_[axis] += modifier;
  401|   987k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 976k, False: 10.9k]
  ------------------
  402|   976k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|   976k|    }
  404|   987k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 970k, False: 17.5k]
  ------------------
  405|   970k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|   970k|    }
  407|   987k|    ++depth;
  408|   987k|  }
  409|     74|  return true;
  410|    116|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  130|  1.94M|        : num_remaining_points(num_remaining_points_),
  131|  1.94M|          last_axis(last_axis_),
  132|  1.94M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  123|   987k|  void DecodeNumber(int nbits, uint32_t* value) {
  124|   987k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|   987k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  114|     93|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    212|      : bit_length_(0),
   87|    212|        num_points_(0),
   88|    212|        num_decoded_points_(0),
   89|    212|        dimension_(dimension),
   90|    212|        p_(dimension, 0),
   91|    212|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    185|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    185|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 0, False: 185]
  ------------------
  197|      0|    return false;
  198|      0|  }
  199|    185|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 20, False: 165]
  ------------------
  200|     20|    return false;
  201|     20|  }
  202|    165|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 0, False: 165]
  ------------------
  203|      0|    return false;
  204|      0|  }
  205|    165|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 2, False: 163]
  ------------------
  206|      2|    return true;
  207|      2|  }
  208|    163|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 4, False: 159]
  ------------------
  209|      4|    return false;
  210|      4|  }
  211|    159|  num_decoded_points_ = 0;
  212|       |
  213|    159|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 17, False: 142]
  ------------------
  214|     17|    return false;
  215|     17|  }
  216|    142|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 2, False: 140]
  ------------------
  217|      2|    return false;
  218|      2|  }
  219|    140|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 5, False: 135]
  ------------------
  220|      5|    return false;
  221|      5|  }
  222|    135|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 133]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|    133|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 84, False: 49]
  ------------------
  227|     84|    return false;
  228|     84|  }
  229|       |
  230|     49|  numbers_decoder_.EndDecoding();
  231|     49|  remaining_bits_decoder_.EndDecoding();
  232|     49|  axis_decoder_.EndDecoding();
  233|     49|  half_decoder_.EndDecoding();
  234|       |
  235|     49|  return true;
  236|    133|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|    133|    uint32_t num_points, OutputIteratorT& oit) {
  264|    133|  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|    133|  base_.assign(dimension_, 0);
  278|    133|  levels_.assign(dimension_, 0);
  279|    133|  undo_.clear();
  280|    133|  uint32_t depth = 0;
  281|    133|  DecodingStatus init_status(num_points, 0, 0);
  282|    133|  std::stack<Status> status_stack;
  283|    133|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  2.47M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 2.47M, False: 49]
  ------------------
  287|  2.47M|    const DecodingStatus status = status_stack.top();
  288|  2.47M|    status_stack.pop();
  289|       |
  290|  2.47M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  2.47M|    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.47M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 1.33M, False: 1.13M]
  ------------------
  295|  1.33M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 1.33M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  2.62M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 2.62M, False: 0]
  ------------------
  299|  2.62M|        const SplitUndo& split = undo_.back();
  300|  2.62M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 2.62M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  2.62M|        base_[split.axis] = split.old_base;
  304|  2.62M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 1.33M, False: 1.28M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  1.33M|          break;
  307|  1.33M|        }
  308|  1.28M|        levels_[split.axis] = split.old_level;
  309|  1.28M|        undo_.pop_back();
  310|  1.28M|      }
  311|  1.33M|      depth = status.depth;
  312|  1.33M|    }
  313|  2.47M|    const VectorUint32& old_base = base_;
  314|  2.47M|    const VectorUint32& levels = levels_;
  315|       |
  316|  2.47M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 2.47M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  2.47M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  2.47M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 2.47M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  2.47M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  2.47M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 976k, False: 1.49M]
  ------------------
  329|   142M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 141M, False: 976k]
  ------------------
  330|   141M|        *oit = old_base;
  331|   141M|        ++oit;
  332|   141M|        ++num_decoded_points_;
  333|   141M|      }
  334|   976k|      continue;
  335|   976k|    }
  336|       |
  337|  1.49M|    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.49M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 104k, False: 1.39M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|   104k|      axes_[0] = axis;
  344|   208k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 104k, False: 104k]
  ------------------
  345|   104k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   104k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 18.7k, False: 85.7k]
  |  |  ------------------
  ------------------
  346|   104k|      }
  347|   249k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 145k, False: 104k]
  ------------------
  348|   455k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 310k, False: 145k]
  ------------------
  349|   310k|          p_[axes_[j]] = 0;
  350|   310k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|   310k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 193k, False: 117k]
  ------------------
  352|   193k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 79, False: 192k]
  ------------------
  353|   193k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     79|              return false;
  355|     79|            }
  356|   193k|          }
  357|   309k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|   309k|        }
  359|   145k|        *oit = p_;
  360|   145k|        ++oit;
  361|   145k|        ++num_decoded_points_;
  362|   145k|      }
  363|   104k|      continue;
  364|   104k|    }
  365|       |
  366|  1.39M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1.39M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  1.39M|    const int num_remaining_bits = bit_length_ - level;
  371|  1.39M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  1.39M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  1.39M|    uint32_t number = 0;
  376|  1.39M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  1.39M|    uint32_t first_half = num_remaining_points / 2;
  379|  1.39M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 5, False: 1.39M]
  ------------------
  380|       |      // Invalid |number|.
  381|      5|      return false;
  382|      5|    }
  383|  1.39M|    first_half -= number;
  384|  1.39M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  1.39M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.37M, False: 12.7k]
  ------------------
  387|  1.37M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.28M, False: 95.6k]
  ------------------
  388|  1.28M|        std::swap(first_half, second_half);
  389|  1.28M|      }
  390|  1.37M|    }
  391|       |
  392|  1.39M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 1.39M]
  ------------------
  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.39M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  1.39M|    levels_[axis] += 1;
  400|  1.39M|    base_[axis] += modifier;
  401|  1.39M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 1.33M, False: 56.6k]
  ------------------
  402|  1.33M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  1.33M|    }
  404|  1.39M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 1.13M, False: 253k]
  ------------------
  405|  1.13M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  1.13M|    }
  407|  1.39M|    ++depth;
  408|  1.39M|  }
  409|     49|  return true;
  410|    133|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  130|  2.47M|        : num_remaining_points(num_remaining_points_),
  131|  2.47M|          last_axis(last_axis_),
  132|  2.47M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  2.47M|    uint32_t last_axis) {
  242|  2.47M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 2.47M, Folded]
  ------------------
  243|  2.47M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.47M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.16M, False: 1.30M]
  |  |  ------------------
  ------------------
  244|  2.47M|  }
  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.47M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  123|  1.39M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  1.39M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  1.39M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  114|     51|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    264|      : bit_length_(0),
   87|    264|        num_points_(0),
   88|    264|        num_decoded_points_(0),
   89|    264|        dimension_(dimension),
   90|    264|        p_(dimension, 0),
   91|    264|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    202|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    202|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 2, False: 200]
  ------------------
  197|      2|    return false;
  198|      2|  }
  199|    200|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 14, False: 186]
  ------------------
  200|     14|    return false;
  201|     14|  }
  202|    186|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 185]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|    185|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 57, False: 128]
  ------------------
  206|     57|    return true;
  207|     57|  }
  208|    128|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 36, False: 92]
  ------------------
  209|     36|    return false;
  210|     36|  }
  211|     92|  num_decoded_points_ = 0;
  212|       |
  213|     92|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 36, False: 56]
  ------------------
  214|     36|    return false;
  215|     36|  }
  216|     56|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 2, False: 54]
  ------------------
  217|      2|    return false;
  218|      2|  }
  219|     54|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 5, False: 49]
  ------------------
  220|      5|    return false;
  221|      5|  }
  222|     49|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 47]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     47|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 32, False: 15]
  ------------------
  227|     32|    return false;
  228|     32|  }
  229|       |
  230|     15|  numbers_decoder_.EndDecoding();
  231|     15|  remaining_bits_decoder_.EndDecoding();
  232|     15|  axis_decoder_.EndDecoding();
  233|     15|  half_decoder_.EndDecoding();
  234|       |
  235|     15|  return true;
  236|     47|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     47|    uint32_t num_points, OutputIteratorT& oit) {
  264|     47|  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|     47|  base_.assign(dimension_, 0);
  278|     47|  levels_.assign(dimension_, 0);
  279|     47|  undo_.clear();
  280|     47|  uint32_t depth = 0;
  281|     47|  DecodingStatus init_status(num_points, 0, 0);
  282|     47|  std::stack<Status> status_stack;
  283|     47|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  98.0k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 98.0k, False: 15]
  ------------------
  287|  98.0k|    const DecodingStatus status = status_stack.top();
  288|  98.0k|    status_stack.pop();
  289|       |
  290|  98.0k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  98.0k|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  98.0k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 89.6k, False: 8.46k]
  ------------------
  295|  89.6k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 89.6k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|   147k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 147k, False: 0]
  ------------------
  299|   147k|        const SplitUndo& split = undo_.back();
  300|   147k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 147k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|   147k|        base_[split.axis] = split.old_base;
  304|   147k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 89.6k, False: 57.5k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  89.6k|          break;
  307|  89.6k|        }
  308|  57.5k|        levels_[split.axis] = split.old_level;
  309|  57.5k|        undo_.pop_back();
  310|  57.5k|      }
  311|  89.6k|      depth = status.depth;
  312|  89.6k|    }
  313|  98.0k|    const VectorUint32& old_base = base_;
  314|  98.0k|    const VectorUint32& levels = levels_;
  315|       |
  316|  98.0k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 98.0k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  98.0k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  98.0k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 4, False: 98.0k]
  ------------------
  322|      4|      return false;
  323|      4|    }
  324|       |
  325|  98.0k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  98.0k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 129, False: 97.9k]
  ------------------
  329|  9.22M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 9.22M, False: 129]
  ------------------
  330|  9.22M|        *oit = old_base;
  331|  9.22M|        ++oit;
  332|  9.22M|        ++num_decoded_points_;
  333|  9.22M|      }
  334|    129|      continue;
  335|    129|    }
  336|       |
  337|  97.9k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  97.9k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 139, False: 97.8k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    139|      axes_[0] = axis;
  344|  8.68k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 8.55k, False: 139]
  ------------------
  345|  8.55k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  8.55k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 123, False: 8.42k]
  |  |  ------------------
  ------------------
  346|  8.55k|      }
  347|    317|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 193, False: 124]
  ------------------
  348|  10.2k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 10.1k, False: 178]
  ------------------
  349|  10.1k|          p_[axes_[j]] = 0;
  350|  10.1k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  10.1k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 9.97k, False: 148]
  ------------------
  352|  9.97k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 15, False: 9.95k]
  ------------------
  353|  9.97k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     15|              return false;
  355|     15|            }
  356|  9.97k|          }
  357|  10.1k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  10.1k|        }
  359|    178|        *oit = p_;
  360|    178|        ++oit;
  361|    178|        ++num_decoded_points_;
  362|    178|      }
  363|    124|      continue;
  364|    139|    }
  365|       |
  366|  97.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 97.8k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  97.8k|    const int num_remaining_bits = bit_length_ - level;
  371|  97.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  97.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  97.8k|    uint32_t number = 0;
  376|  97.8k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  97.8k|    uint32_t first_half = num_remaining_points / 2;
  379|  97.8k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 13, False: 97.7k]
  ------------------
  380|       |      // Invalid |number|.
  381|     13|      return false;
  382|     13|    }
  383|  97.7k|    first_half -= number;
  384|  97.7k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  97.7k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 97.7k, False: 4]
  ------------------
  387|  97.7k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 89.5k, False: 8.21k]
  ------------------
  388|  89.5k|        std::swap(first_half, second_half);
  389|  89.5k|      }
  390|  97.7k|    }
  391|       |
  392|  97.7k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 97.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|  97.7k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  97.7k|    levels_[axis] += 1;
  400|  97.7k|    base_[axis] += modifier;
  401|  97.7k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 89.7k, False: 8.05k]
  ------------------
  402|  89.7k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  89.7k|    }
  404|  97.7k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 8.41k, False: 89.3k]
  ------------------
  405|  8.41k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  8.41k|    }
  407|  97.7k|    ++depth;
  408|  97.7k|  }
  409|     15|  return true;
  410|     47|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  130|  98.2k|        : num_remaining_points(num_remaining_points_),
  131|  98.2k|          last_axis(last_axis_),
  132|  98.2k|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  123|  97.8k|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  97.8k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  97.8k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  114|     72|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  4.51M|    uint32_t last_axis) {
  242|  4.51M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 4.51M, Folded]
  ------------------
  243|  4.51M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.51M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.53M, False: 973k]
  |  |  ------------------
  ------------------
  244|  4.51M|  }
  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.51M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  71.8k|    uint32_t last_axis) {
  242|  71.8k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 71.8k, Folded]
  ------------------
  243|  71.8k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  71.8k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 9.50k, False: 62.3k]
  |  |  ------------------
  ------------------
  244|  71.8k|  }
  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|  71.8k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  1.94M|    uint32_t last_axis) {
  242|  1.94M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 1.94M, Folded]
  ------------------
  243|  1.94M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.94M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.73M, False: 207k]
  |  |  ------------------
  ------------------
  244|  1.94M|  }
  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|  1.94M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  98.0k|    uint32_t last_axis) {
  242|  98.0k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [Folded, False: 98.0k]
  ------------------
  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|  98.0k|  uint32_t best_axis = 0;
  247|  98.0k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 97.8k, False: 258]
  ------------------
  248|  14.2M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 14.1M, False: 97.8k]
  ------------------
  249|  14.1M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 97.0k, False: 14.0M]
  ------------------
  250|  97.0k|        best_axis = axis;
  251|  97.0k|      }
  252|  14.1M|    }
  253|  97.8k|  } else {
  254|    258|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|    258|  }
  256|       |
  257|  98.0k|  return best_axis;
  258|  98.0k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    153|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    153|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    153|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    153|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    153|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 0, False: 153]
  ------------------
  197|      0|    return false;
  198|      0|  }
  199|    153|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 17, False: 136]
  ------------------
  200|     17|    return false;
  201|     17|  }
  202|    136|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 2, False: 134]
  ------------------
  203|      2|    return false;
  204|      2|  }
  205|    134|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 133]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|    133|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 133]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|    133|  num_decoded_points_ = 0;
  212|       |
  213|    133|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 46, False: 87]
  ------------------
  214|     46|    return false;
  215|     46|  }
  216|     87|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 16, False: 71]
  ------------------
  217|     16|    return false;
  218|     16|  }
  219|     71|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 2, False: 69]
  ------------------
  220|      2|    return false;
  221|      2|  }
  222|     69|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 67]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     67|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 55, False: 12]
  ------------------
  227|     55|    return false;
  228|     55|  }
  229|       |
  230|     12|  numbers_decoder_.EndDecoding();
  231|     12|  remaining_bits_decoder_.EndDecoding();
  232|     12|  axis_decoder_.EndDecoding();
  233|     12|  half_decoder_.EndDecoding();
  234|       |
  235|     12|  return true;
  236|     67|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     67|    uint32_t num_points, OutputIteratorT& oit) {
  264|     67|  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|     67|  base_.assign(dimension_, 0);
  278|     67|  levels_.assign(dimension_, 0);
  279|     67|  undo_.clear();
  280|     67|  uint32_t depth = 0;
  281|     67|  DecodingStatus init_status(num_points, 0, 0);
  282|     67|  std::stack<Status> status_stack;
  283|     67|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  1.34M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 1.34M, False: 12]
  ------------------
  287|  1.34M|    const DecodingStatus status = status_stack.top();
  288|  1.34M|    status_stack.pop();
  289|       |
  290|  1.34M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  1.34M|    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.34M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 671k, False: 671k]
  ------------------
  295|   671k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 671k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  1.34M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 1.34M, False: 0]
  ------------------
  299|  1.34M|        const SplitUndo& split = undo_.back();
  300|  1.34M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 1.34M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  1.34M|        base_[split.axis] = split.old_base;
  304|  1.34M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 671k, False: 671k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|   671k|          break;
  307|   671k|        }
  308|   671k|        levels_[split.axis] = split.old_level;
  309|   671k|        undo_.pop_back();
  310|   671k|      }
  311|   671k|      depth = status.depth;
  312|   671k|    }
  313|  1.34M|    const VectorUint32& old_base = base_;
  314|  1.34M|    const VectorUint32& levels = levels_;
  315|       |
  316|  1.34M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 1.34M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  1.34M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  1.34M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 1.34M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  1.34M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  1.34M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 670k, False: 672k]
  ------------------
  329|  56.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 55.8M, False: 670k]
  ------------------
  330|  55.8M|        *oit = old_base;
  331|  55.8M|        ++oit;
  332|  55.8M|        ++num_decoded_points_;
  333|  55.8M|      }
  334|   670k|      continue;
  335|   670k|    }
  336|       |
  337|   672k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|   672k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 849, False: 672k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    849|      axes_[0] = axis;
  344|  2.54k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 1.69k, False: 849]
  ------------------
  345|  1.69k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.69k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 239, False: 1.45k]
  |  |  ------------------
  ------------------
  346|  1.69k|      }
  347|  2.27k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.45k, False: 820]
  ------------------
  348|  5.75k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 4.32k, False: 1.43k]
  ------------------
  349|  4.32k|          p_[axes_[j]] = 0;
  350|  4.32k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  4.32k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 2.13k, False: 2.18k]
  ------------------
  352|  2.13k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 29, False: 2.11k]
  ------------------
  353|  2.13k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     29|              return false;
  355|     29|            }
  356|  2.13k|          }
  357|  4.29k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  4.29k|        }
  359|  1.43k|        *oit = p_;
  360|  1.43k|        ++oit;
  361|  1.43k|        ++num_decoded_points_;
  362|  1.43k|      }
  363|    820|      continue;
  364|    849|    }
  365|       |
  366|   672k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 672k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|   672k|    const int num_remaining_bits = bit_length_ - level;
  371|   672k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|   672k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|   672k|    uint32_t number = 0;
  376|   672k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|   672k|    uint32_t first_half = num_remaining_points / 2;
  379|   672k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 26, False: 671k]
  ------------------
  380|       |      // Invalid |number|.
  381|     26|      return false;
  382|     26|    }
  383|   671k|    first_half -= number;
  384|   671k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|   671k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 375k, False: 296k]
  ------------------
  387|   375k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 374k, False: 766]
  ------------------
  388|   374k|        std::swap(first_half, second_half);
  389|   374k|      }
  390|   375k|    }
  391|       |
  392|   671k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 671k]
  ------------------
  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|   671k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|   671k|    levels_[axis] += 1;
  400|   671k|    base_[axis] += modifier;
  401|   671k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 671k, False: 45]
  ------------------
  402|   671k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|   671k|    }
  404|   671k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 671k, False: 96]
  ------------------
  405|   671k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|   671k|    }
  407|   671k|    ++depth;
  408|   671k|  }
  409|     12|  return true;
  410|     67|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    110|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    110|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    110|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    110|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    110|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 1, False: 109]
  ------------------
  197|      1|    return false;
  198|      1|  }
  199|    109|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 11, False: 98]
  ------------------
  200|     11|    return false;
  201|     11|  }
  202|     98|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 97]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|     97|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 96]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|     96|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 96]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|     96|  num_decoded_points_ = 0;
  212|       |
  213|     96|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 13, False: 83]
  ------------------
  214|     13|    return false;
  215|     13|  }
  216|     83|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 8, False: 75]
  ------------------
  217|      8|    return false;
  218|      8|  }
  219|     75|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 3, False: 72]
  ------------------
  220|      3|    return false;
  221|      3|  }
  222|     72|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 4, False: 68]
  ------------------
  223|      4|    return false;
  224|      4|  }
  225|       |
  226|     68|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 52, False: 16]
  ------------------
  227|     52|    return false;
  228|     52|  }
  229|       |
  230|     16|  numbers_decoder_.EndDecoding();
  231|     16|  remaining_bits_decoder_.EndDecoding();
  232|     16|  axis_decoder_.EndDecoding();
  233|     16|  half_decoder_.EndDecoding();
  234|       |
  235|     16|  return true;
  236|     68|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_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|  1.90M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 1.90M, False: 16]
  ------------------
  287|  1.90M|    const DecodingStatus status = status_stack.top();
  288|  1.90M|    status_stack.pop();
  289|       |
  290|  1.90M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  1.90M|    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.90M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 950k, False: 951k]
  ------------------
  295|   950k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 950k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  1.90M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 1.90M, False: 0]
  ------------------
  299|  1.90M|        const SplitUndo& split = undo_.back();
  300|  1.90M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 1.90M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  1.90M|        base_[split.axis] = split.old_base;
  304|  1.90M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 950k, False: 950k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|   950k|          break;
  307|   950k|        }
  308|   950k|        levels_[split.axis] = split.old_level;
  309|   950k|        undo_.pop_back();
  310|   950k|      }
  311|   950k|      depth = status.depth;
  312|   950k|    }
  313|  1.90M|    const VectorUint32& old_base = base_;
  314|  1.90M|    const VectorUint32& levels = levels_;
  315|       |
  316|  1.90M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 1.90M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  1.90M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  1.90M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 1.90M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  1.90M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  1.90M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 949k, False: 952k]
  ------------------
  329|  42.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 41.3M, False: 949k]
  ------------------
  330|  41.3M|        *oit = old_base;
  331|  41.3M|        ++oit;
  332|  41.3M|        ++num_decoded_points_;
  333|  41.3M|      }
  334|   949k|      continue;
  335|   949k|    }
  336|       |
  337|   952k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|   952k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 975, False: 951k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    975|      axes_[0] = axis;
  344|  2.92k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 1.95k, False: 975]
  ------------------
  345|  1.95k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.95k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 252, False: 1.69k]
  |  |  ------------------
  ------------------
  346|  1.95k|      }
  347|  2.51k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.57k, False: 941]
  ------------------
  348|  6.20k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 4.66k, False: 1.53k]
  ------------------
  349|  4.66k|          p_[axes_[j]] = 0;
  350|  4.66k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  4.66k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 2.47k, False: 2.19k]
  ------------------
  352|  2.47k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 34, False: 2.44k]
  ------------------
  353|  2.47k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     34|              return false;
  355|     34|            }
  356|  2.47k|          }
  357|  4.63k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  4.63k|        }
  359|  1.53k|        *oit = p_;
  360|  1.53k|        ++oit;
  361|  1.53k|        ++num_decoded_points_;
  362|  1.53k|      }
  363|    941|      continue;
  364|    975|    }
  365|       |
  366|   951k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 951k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|   951k|    const int num_remaining_bits = bit_length_ - level;
  371|   951k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|   951k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|   951k|    uint32_t number = 0;
  376|   951k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|   951k|    uint32_t first_half = num_remaining_points / 2;
  379|   951k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 18, False: 951k]
  ------------------
  380|       |      // Invalid |number|.
  381|     18|      return false;
  382|     18|    }
  383|   951k|    first_half -= number;
  384|   951k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|   951k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 498k, False: 452k]
  ------------------
  387|   498k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 498k, False: 430]
  ------------------
  388|   498k|        std::swap(first_half, second_half);
  389|   498k|      }
  390|   498k|    }
  391|       |
  392|   951k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 951k]
  ------------------
  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|   951k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|   951k|    levels_[axis] += 1;
  400|   951k|    base_[axis] += modifier;
  401|   951k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 951k, False: 22]
  ------------------
  402|   951k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|   951k|    }
  404|   951k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 951k, False: 77]
  ------------------
  405|   951k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|   951k|    }
  407|   951k|    ++depth;
  408|   951k|  }
  409|     16|  return true;
  410|     68|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    135|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    135|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    135|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    135|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    135|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 1, False: 134]
  ------------------
  197|      1|    return false;
  198|      1|  }
  199|    134|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 26, False: 108]
  ------------------
  200|     26|    return false;
  201|     26|  }
  202|    108|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 107]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|    107|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 106]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|    106|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 106]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|    106|  num_decoded_points_ = 0;
  212|       |
  213|    106|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 37, False: 69]
  ------------------
  214|     37|    return false;
  215|     37|  }
  216|     69|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 4, False: 65]
  ------------------
  217|      4|    return false;
  218|      4|  }
  219|     65|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 1, False: 64]
  ------------------
  220|      1|    return false;
  221|      1|  }
  222|     64|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 63]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|     63|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 61, False: 2]
  ------------------
  227|     61|    return false;
  228|     61|  }
  229|       |
  230|      2|  numbers_decoder_.EndDecoding();
  231|      2|  remaining_bits_decoder_.EndDecoding();
  232|      2|  axis_decoder_.EndDecoding();
  233|      2|  half_decoder_.EndDecoding();
  234|       |
  235|      2|  return true;
  236|     63|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     63|    uint32_t num_points, OutputIteratorT& oit) {
  264|     63|  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|     63|  base_.assign(dimension_, 0);
  278|     63|  levels_.assign(dimension_, 0);
  279|     63|  undo_.clear();
  280|     63|  uint32_t depth = 0;
  281|     63|  DecodingStatus init_status(num_points, 0, 0);
  282|     63|  std::stack<Status> status_stack;
  283|     63|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  25.9k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 25.9k, False: 2]
  ------------------
  287|  25.9k|    const DecodingStatus status = status_stack.top();
  288|  25.9k|    status_stack.pop();
  289|       |
  290|  25.9k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  25.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|  25.9k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 12.5k, False: 13.4k]
  ------------------
  295|  12.5k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 12.5k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  24.9k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 24.9k, False: 0]
  ------------------
  299|  24.9k|        const SplitUndo& split = undo_.back();
  300|  24.9k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 24.9k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  24.9k|        base_[split.axis] = split.old_base;
  304|  24.9k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 12.5k, False: 12.4k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  12.5k|          break;
  307|  12.5k|        }
  308|  12.4k|        levels_[split.axis] = split.old_level;
  309|  12.4k|        undo_.pop_back();
  310|  12.4k|      }
  311|  12.5k|      depth = status.depth;
  312|  12.5k|    }
  313|  25.9k|    const VectorUint32& old_base = base_;
  314|  25.9k|    const VectorUint32& levels = levels_;
  315|       |
  316|  25.9k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 25.9k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  25.9k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  25.9k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 25.9k]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  25.9k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  25.9k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 11.8k, False: 14.1k]
  ------------------
  329|  5.16M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 5.15M, False: 11.8k]
  ------------------
  330|  5.15M|        *oit = old_base;
  331|  5.15M|        ++oit;
  332|  5.15M|        ++num_decoded_points_;
  333|  5.15M|      }
  334|  11.8k|      continue;
  335|  11.8k|    }
  336|       |
  337|  14.1k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  14.1k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 600, False: 13.5k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    600|      axes_[0] = axis;
  344|  1.80k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 1.20k, False: 600]
  ------------------
  345|  1.20k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.20k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 278, False: 922]
  |  |  ------------------
  ------------------
  346|  1.20k|      }
  347|  1.60k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.02k, False: 583]
  ------------------
  348|  4.04k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 3.04k, False: 1.00k]
  ------------------
  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.90k, False: 1.14k]
  ------------------
  352|  1.90k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 17, False: 1.88k]
  ------------------
  353|  1.90k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     17|              return false;
  355|     17|            }
  356|  1.90k|          }
  357|  3.02k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  3.02k|        }
  359|  1.00k|        *oit = p_;
  360|  1.00k|        ++oit;
  361|  1.00k|        ++num_decoded_points_;
  362|  1.00k|      }
  363|    583|      continue;
  364|    600|    }
  365|       |
  366|  13.5k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 13.5k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  13.5k|    const int num_remaining_bits = bit_length_ - level;
  371|  13.5k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  13.5k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  13.5k|    uint32_t number = 0;
  376|  13.5k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  13.5k|    uint32_t first_half = num_remaining_points / 2;
  379|  13.5k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 44, False: 13.4k]
  ------------------
  380|       |      // Invalid |number|.
  381|     44|      return false;
  382|     44|    }
  383|  13.4k|    first_half -= number;
  384|  13.4k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  13.4k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 7.30k, False: 6.16k]
  ------------------
  387|  7.30k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 5.68k, False: 1.61k]
  ------------------
  388|  5.68k|        std::swap(first_half, second_half);
  389|  5.68k|      }
  390|  7.30k|    }
  391|       |
  392|  13.4k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 13.4k]
  ------------------
  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|  13.4k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  13.4k|    levels_[axis] += 1;
  400|  13.4k|    base_[axis] += modifier;
  401|  13.4k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 13.3k, False: 83]
  ------------------
  402|  13.3k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  13.3k|    }
  404|  13.4k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 13.3k, False: 116]
  ------------------
  405|  13.3k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  13.3k|    }
  407|  13.4k|    ++depth;
  408|  13.4k|  }
  409|      2|  return true;
  410|     63|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    124|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    124|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    124|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    124|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    124|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 0, False: 124]
  ------------------
  197|      0|    return false;
  198|      0|  }
  199|    124|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 4, False: 120]
  ------------------
  200|      4|    return false;
  201|      4|  }
  202|    120|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 2, False: 118]
  ------------------
  203|      2|    return false;
  204|      2|  }
  205|    118|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 117]
  ------------------
  206|      1|    return true;
  207|      1|  }
  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: 39, False: 78]
  ------------------
  214|     39|    return false;
  215|     39|  }
  216|     78|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 6, False: 72]
  ------------------
  217|      6|    return false;
  218|      6|  }
  219|     72|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 4, False: 68]
  ------------------
  220|      4|    return false;
  221|      4|  }
  222|     68|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 67]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|     67|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 61, False: 6]
  ------------------
  227|     61|    return false;
  228|     61|  }
  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|     67|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     67|    uint32_t num_points, OutputIteratorT& oit) {
  264|     67|  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|     67|  base_.assign(dimension_, 0);
  278|     67|  levels_.assign(dimension_, 0);
  279|     67|  undo_.clear();
  280|     67|  uint32_t depth = 0;
  281|     67|  DecodingStatus init_status(num_points, 0, 0);
  282|     67|  std::stack<Status> status_stack;
  283|     67|  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: 6]
  ------------------
  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.10M]
  ------------------
  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.10M]
  ------------------
  329|  16.6M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 14.5M, False: 2.10M]
  ------------------
  330|  14.5M|        *oit = old_base;
  331|  14.5M|        ++oit;
  332|  14.5M|        ++num_decoded_points_;
  333|  14.5M|      }
  334|  2.10M|      continue;
  335|  2.10M|    }
  336|       |
  337|  2.10M|    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.10M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 1.07k, False: 2.10M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|  1.07k|      axes_[0] = axis;
  344|  3.21k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 2.14k, False: 1.07k]
  ------------------
  345|  2.14k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.14k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 484, False: 1.65k]
  |  |  ------------------
  ------------------
  346|  2.14k|      }
  347|  2.92k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.88k, False: 1.04k]
  ------------------
  348|  7.46k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 5.60k, False: 1.85k]
  ------------------
  349|  5.60k|          p_[axes_[j]] = 0;
  350|  5.60k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  5.60k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 4.19k, False: 1.41k]
  ------------------
  352|  4.19k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 21, False: 4.17k]
  ------------------
  353|  4.19k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     21|              return false;
  355|     21|            }
  356|  4.19k|          }
  357|  5.58k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  5.58k|        }
  359|  1.85k|        *oit = p_;
  360|  1.85k|        ++oit;
  361|  1.85k|        ++num_decoded_points_;
  362|  1.85k|      }
  363|  1.04k|      continue;
  364|  1.07k|    }
  365|       |
  366|  2.10M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 2.10M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  2.10M|    const int num_remaining_bits = bit_length_ - level;
  371|  2.10M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  2.10M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  2.10M|    uint32_t number = 0;
  376|  2.10M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  2.10M|    uint32_t first_half = num_remaining_points / 2;
  379|  2.10M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 40, False: 2.10M]
  ------------------
  380|       |      // Invalid |number|.
  381|     40|      return false;
  382|     40|    }
  383|  2.10M|    first_half -= number;
  384|  2.10M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  2.10M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 726k, False: 1.38M]
  ------------------
  387|   726k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 725k, False: 1.01k]
  ------------------
  388|   725k|        std::swap(first_half, second_half);
  389|   725k|      }
  390|   726k|    }
  391|       |
  392|  2.10M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 2.10M]
  ------------------
  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.10M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  2.10M|    levels_[axis] += 1;
  400|  2.10M|    base_[axis] += modifier;
  401|  2.10M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 2.10M, False: 62]
  ------------------
  402|  2.10M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  2.10M|    }
  404|  2.10M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 2.10M, False: 118]
  ------------------
  405|  2.10M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  2.10M|    }
  407|  2.10M|    ++depth;
  408|  2.10M|  }
  409|      6|  return true;
  410|     67|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|     52|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|     52|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|     52|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|     52|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|     52|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 0, False: 52]
  ------------------
  197|      0|    return false;
  198|      0|  }
  199|     52|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 14, False: 38]
  ------------------
  200|     14|    return false;
  201|     14|  }
  202|     38|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 37]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|     37|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 3, False: 34]
  ------------------
  206|      3|    return true;
  207|      3|  }
  208|     34|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 34]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|     34|  num_decoded_points_ = 0;
  212|       |
  213|     34|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 34, False: 0]
  ------------------
  214|     34|    return false;
  215|     34|  }
  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|     27|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|     27|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|     27|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|     27|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|     27|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 0, False: 27]
  ------------------
  197|      0|    return false;
  198|      0|  }
  199|     27|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 8, False: 19]
  ------------------
  200|      8|    return false;
  201|      8|  }
  202|     19|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 18]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|     18|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 17]
  ------------------
  206|      1|    return true;
  207|      1|  }
  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|     62|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|     62|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|     62|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|     62|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 0, False: 62]
  ------------------
  197|      0|    return false;
  198|      0|  }
  199|     62|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 11, False: 51]
  ------------------
  200|     11|    return false;
  201|     11|  }
  202|     51|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 2, False: 49]
  ------------------
  203|      2|    return false;
  204|      2|  }
  205|     49|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 48]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|     48|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 48]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|     48|  num_decoded_points_ = 0;
  212|       |
  213|     48|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 48, False: 0]
  ------------------
  214|     48|    return false;
  215|     48|  }
  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|    736|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    736|  qinfo_.quantization_bits = 0;
   67|    736|  qinfo_.range = 0;
   68|    736|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    725|    DecoderBuffer* buffer, std::vector<Point3ui>* qpoints) {
   72|    725|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 725]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|    725|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 15, False: 710]
  ------------------
   76|     15|    return false;
   77|     15|  }
   78|    710|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 710]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|    710|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 710]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|    710|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 43, False: 667]
  |  Branch (84:38): [True: 19, False: 24]
  ------------------
   85|     19|    return false;
   86|     19|  }
   87|    691|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 691]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    691|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 26, False: 665]
  ------------------
   93|     26|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|     26|#define DRACO_LOGE printf
  ------------------
   94|     26|               compression_level_);
   95|     26|    return false;
   96|     26|  }
   97|       |
   98|    665|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    665|      std::back_inserter(*qpoints);
  100|    665|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    665|                           Converter>
  102|    665|      oit(oit_qpoints);
  103|    665|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 663, False: 2]
  ------------------
  104|    663|    qpoints->reserve(num_points_);
  105|    663|    switch (compression_level_) {
  106|    153|      case 0: {
  ------------------
  |  Branch (106:7): [True: 153, False: 510]
  ------------------
  107|    153|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|    153|        qpoints_decoder.DecodePoints(buffer, oit);
  109|    153|        break;
  110|      0|      }
  111|    110|      case 1: {
  ------------------
  |  Branch (111:7): [True: 110, False: 553]
  ------------------
  112|    110|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|    110|        qpoints_decoder.DecodePoints(buffer, oit);
  114|    110|        break;
  115|      0|      }
  116|    135|      case 2: {
  ------------------
  |  Branch (116:7): [True: 135, False: 528]
  ------------------
  117|    135|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|    135|        qpoints_decoder.DecodePoints(buffer, oit);
  119|    135|        break;
  120|      0|      }
  121|    124|      case 3: {
  ------------------
  |  Branch (121:7): [True: 124, False: 539]
  ------------------
  122|    124|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    124|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    124|        break;
  125|      0|      }
  126|     52|      case 4: {
  ------------------
  |  Branch (126:7): [True: 52, False: 611]
  ------------------
  127|     52|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     52|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     52|        break;
  130|      0|      }
  131|     27|      case 5: {
  ------------------
  |  Branch (131:7): [True: 27, False: 636]
  ------------------
  132|     27|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     27|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     27|        break;
  135|      0|      }
  136|     62|      case 6: {
  ------------------
  |  Branch (136:7): [True: 62, False: 601]
  ------------------
  137|     62|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     62|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     62|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 663]
  ------------------
  142|      0|        return false;
  143|    663|    }
  144|    663|  }
  145|       |
  146|    665|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 651, False: 14]
  ------------------
  147|    651|    return false;
  148|    651|  }
  149|     14|  return true;
  150|    665|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    665|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   116M|  Self& operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   116M|  const Self& operator=(const SourceType& source) {
   56|   116M|    *oit_ = Converter()(source);
   57|   116M|    return *this;
   58|   116M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   116M|  Point3ui operator()(const std::vector<uint32_t>& v) {
   30|   116M|    return Point3ui(v[0], v[1], v[2]);
   31|   116M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   116M|  const Self& operator++() {
   46|   116M|    ++oit_;
   47|   116M|    return *this;
   48|   116M|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  18.5M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t* out_value) {
   58|  18.5M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 18.5M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  18.5M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  18.5M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   996M|  bool Decode(void* out_data, size_t size_to_decode) {
   77|   996M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 321, False: 996M]
  ------------------
   78|    321|      return false;  // Buffer overflow.
   79|    321|    }
   80|   996M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   996M|    pos_ += size_to_decode;
   82|   996M|    return true;
   83|   996M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  41.5k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  12.2k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  56.9k|  const char* data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   208k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  6.97k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  18.5M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  6.82M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  8.50k|    void reset(const void* b, size_t s) {
  131|  8.50k|      bit_offset_ = 0;
  132|  8.50k|      bit_buffer_ = static_cast<const uint8_t*>(b);
  133|  8.50k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  8.50k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  7.55k|    uint64_t BitsDecoded() const { return static_cast<uint64_t>(bit_offset_); }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  158|  18.5M|    bool GetBits(uint32_t nbits, uint32_t* x) {
  159|  18.5M|      if (nbits > 32) {
  ------------------
  |  Branch (159:11): [True: 3, False: 18.5M]
  ------------------
  160|      3|        return false;
  161|      3|      }
  162|  18.5M|      uint32_t value = 0;
  163|  42.3M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (163:30): [True: 23.7M, False: 18.5M]
  ------------------
  164|  23.7M|        value |= GetBit() << bit;
  165|  23.7M|      }
  166|  18.5M|      *x = value;
  167|  18.5M|      return true;
  168|  18.5M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  173|  23.7M|    int GetBit() {
  174|  23.7M|      const size_t off = bit_offset_;
  175|  23.7M|      const size_t byte_offset = off >> 3;
  176|  23.7M|      const int bit_shift = static_cast<int>(off & 0x7);
  177|  23.7M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (177:11): [True: 22.6M, False: 1.10M]
  ------------------
  178|  22.6M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  179|  22.6M|        bit_offset_ = off + 1;
  180|  22.6M|        return bit;
  181|  22.6M|      }
  182|  1.10M|      return 0;
  183|  23.7M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  9.76M|  bool Decode(T* out_val) {
   69|  9.76M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2.78k, False: 9.76M]
  ------------------
   70|  2.78k|      return false;
   71|  2.78k|    }
   72|  9.76M|    pos_ += sizeof(T);
   73|  9.76M|    return true;
   74|  9.76M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  9.76M|  bool Peek(T* out_val) {
   88|  9.76M|    const size_t size_to_decode = sizeof(T);
   89|  9.76M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2.78k, False: 9.76M]
  ------------------
   90|  2.78k|      return false;  // Buffer overflow.
   91|  2.78k|    }
   92|  9.76M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  9.76M|    return true;
   94|  9.76M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  16.0k|  bool Decode(T* out_val) {
   69|  16.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 113, False: 15.9k]
  ------------------
   70|    113|      return false;
   71|    113|    }
   72|  15.9k|    pos_ += sizeof(T);
   73|  15.9k|    return true;
   74|  16.0k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  16.0k|  bool Peek(T* out_val) {
   88|  16.0k|    const size_t size_to_decode = sizeof(T);
   89|  16.0k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 113, False: 15.9k]
  ------------------
   90|    113|      return false;  // Buffer overflow.
   91|    113|    }
   92|  15.9k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  15.9k|    return true;
   94|  16.0k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   833k|  bool Decode(T* out_val) {
   69|   833k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 251, False: 833k]
  ------------------
   70|    251|      return false;
   71|    251|    }
   72|   833k|    pos_ += sizeof(T);
   73|   833k|    return true;
   74|   833k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   833k|  bool Peek(T* out_val) {
   88|   833k|    const size_t size_to_decode = sizeof(T);
   89|   833k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 251, False: 833k]
  ------------------
   90|    251|      return false;  // Buffer overflow.
   91|    251|    }
   92|   833k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   833k|    return true;
   94|   833k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  25.0k|  bool Decode(T* out_val) {
   69|  25.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 75, False: 25.0k]
  ------------------
   70|     75|      return false;
   71|     75|    }
   72|  25.0k|    pos_ += sizeof(T);
   73|  25.0k|    return true;
   74|  25.0k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  25.0k|  bool Peek(T* out_val) {
   88|  25.0k|    const size_t size_to_decode = sizeof(T);
   89|  25.0k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 75, False: 25.0k]
  ------------------
   90|     75|      return false;  // Buffer overflow.
   91|     75|    }
   92|  25.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  25.0k|    return true;
   94|  25.0k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   252k|  bool Decode(T* out_val) {
   69|   252k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 115, False: 252k]
  ------------------
   70|    115|      return false;
   71|    115|    }
   72|   252k|    pos_ += sizeof(T);
   73|   252k|    return true;
   74|   252k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   252k|  bool Peek(T* out_val) {
   88|   252k|    const size_t size_to_decode = sizeof(T);
   89|   252k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 115, False: 252k]
  ------------------
   90|    115|      return false;  // Buffer overflow.
   91|    115|    }
   92|   252k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   252k|    return true;
   94|   252k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  37.4k|  bool Decode(T* out_val) {
   69|  37.4k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 8, False: 37.4k]
  ------------------
   70|      8|      return false;
   71|      8|    }
   72|  37.4k|    pos_ += sizeof(T);
   73|  37.4k|    return true;
   74|  37.4k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  37.4k|  bool Peek(T* out_val) {
   88|  37.4k|    const size_t size_to_decode = sizeof(T);
   89|  37.4k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 8, False: 37.4k]
  ------------------
   90|      8|      return false;  // Buffer overflow.
   91|      8|    }
   92|  37.4k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  37.4k|    return true;
   94|  37.4k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.42k|  bool Decode(T* out_val) {
   69|  1.42k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 9, False: 1.41k]
  ------------------
   70|      9|      return false;
   71|      9|    }
   72|  1.41k|    pos_ += sizeof(T);
   73|  1.41k|    return true;
   74|  1.42k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.42k|  bool Peek(T* out_val) {
   88|  1.42k|    const size_t size_to_decode = sizeof(T);
   89|  1.42k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 9, False: 1.41k]
  ------------------
   90|      9|      return false;  // Buffer overflow.
   91|      9|    }
   92|  1.41k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.41k|    return true;
   94|  1.42k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    943|  bool Decode(T* out_val) {
   69|    943|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 5, False: 938]
  ------------------
   70|      5|      return false;
   71|      5|    }
   72|    938|    pos_ += sizeof(T);
   73|    938|    return true;
   74|    943|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    943|  bool Peek(T* out_val) {
   88|    943|    const size_t size_to_decode = sizeof(T);
   89|    943|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 5, False: 938]
  ------------------
   90|      5|      return false;  // Buffer overflow.
   91|      5|    }
   92|    938|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    938|    return true;
   94|    943|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   502M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   448M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  14.0M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|  14.0M|    return value_ >= val;
  100|  14.0M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   339M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  4.04G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  34.8M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   150M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   150M|    value_ = i.value_;
  153|   150M|    return *this;
  154|   150M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   266M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   266M|    value_ = i.value_;
  153|   266M|    return *this;
  154|   266M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  34.8M|  inline ThisIndexType& operator++() {
  103|  34.8M|    ++value_;
  104|  34.8M|    return *this;
  105|  34.8M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  3.01G|  constexpr bool operator==(const IndexType& i) const {
   76|  3.01G|    return value_ == i.value_;
   77|  3.01G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  1.17G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  3.04k|  constexpr bool operator<(const IndexType& i) const {
   88|  3.04k|    return value_ < i.value_;
   89|  3.04k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   164M|  constexpr bool operator==(const IndexType& i) const {
   76|   164M|    return value_ == i.value_;
   77|   164M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   249M|  constexpr ThisIndexType operator-(const ValueTypeT& val) const {
  132|   249M|    return ThisIndexType(value_ - val);
  133|   249M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   874M|  constexpr ThisIndexType operator+(const ValueTypeT& val) const {
  126|   874M|    return ThisIndexType(value_ + val);
  127|   874M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  30.1M|  constexpr bool operator==(const IndexType& i) const {
   76|  30.1M|    return value_ == i.value_;
   77|  30.1M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   300M|  constexpr bool operator!=(const IndexType& i) const {
   82|   300M|    return value_ != i.value_;
   83|   300M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   449M|  constexpr bool operator!=(const IndexType& i) const {
   82|   449M|    return value_ != i.value_;
   83|   449M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   646M|  inline ThisIndexType& operator++() {
  103|   646M|    ++value_;
  104|   646M|    return *this;
  105|   646M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   514M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   514M|    value_ = i.value_;
  153|   514M|    return *this;
  154|   514M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.27G|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  1.27G|    value_ = i.value_;
  153|  1.27G|    return *this;
  154|  1.27G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  62.3M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|  62.3M|    return value_ >= val;
  100|  62.3M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  14.1M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.37G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  22.7G|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   249M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  16.5G|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   290M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  22.0M|  constexpr ThisIndexType operator+(const ValueTypeT& val) const {
  126|  22.0M|    return ThisIndexType(value_ + val);
  127|  22.0M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   202M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  42.0M|  constexpr bool operator<(const IndexType& i) const {
   88|  42.0M|    return value_ < i.value_;
   89|  42.0M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   623M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   266M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  98.4M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   396M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   781M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  8.13M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  8.13M|    value_ = i.value_;
  153|  8.13M|    return *this;
  154|  8.13M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  14.1M|  inline ThisIndexType operator+=(const ValueTypeT& val) {
  140|  14.1M|    value_ += val;
  141|  14.1M|    return *this;
  142|  14.1M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  42.1M|  inline ThisIndexType& operator=(const ValueTypeT& val) {
  156|  42.1M|    value_ = val;
  157|  42.1M|    return *this;
  158|  42.1M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   224M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  8.72M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  8.71M|  inline ThisIndexType& operator++() {
  103|  8.71M|    ++value_;
  104|  8.71M|    return *this;
  105|  8.71M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  38.5M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|  40.6M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   327M|  inline ThisIndexType& operator++() {
  103|   327M|    ++value_;
  104|   327M|    return *this;
  105|   327M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|  40.6M|  inline ThisIndexType& operator++() {
  103|  40.6M|    ++value_;
  104|  40.6M|    return *this;
  105|  40.6M|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   289M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|   289M|    return value_ >= val;
  100|   289M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  57.9M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  57.9M|    return vector_[index.value()];
   75|  57.9M|  }
_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|  14.7k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  23.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|   100M|  inline reference operator[](const IndexTypeT& index) {
   71|   100M|    return vector_[index.value()];
   72|   100M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  3.04k|  void push_back(const ValueTypeT& val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  28.0M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  4.62k|  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|  14.0M|  inline reference operator[](const IndexTypeT& index) {
   71|  14.0M|    return vector_[index.value()];
   72|  14.0M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  37.5M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  37.5M|    return vector_[index.value()];
   75|  37.5M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   242M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  18.7M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   404M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|   404M|    return vector_[index.value()];
   75|   404M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  1.01G|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  1.01G|    return vector_[index.value()];
   75|  1.01G|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   464M|  inline reference operator[](const IndexTypeT& index) {
   71|   464M|    return vector_[index.value()];
   72|   464M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  70.1M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  70.1M|    return vector_[index.value()];
   75|  70.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   381M|  inline reference operator[](const IndexTypeT& index) {
   71|   381M|    return vector_[index.value()];
   72|   381M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   124M|  void push_back(const ValueTypeT& val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   260M|  inline reference operator[](const IndexTypeT& index) {
   71|   260M|    return vector_[index.value()];
   72|   260M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.26k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   270M|  inline reference operator[](const IndexTypeT& index) {
   71|   270M|    return vector_[index.value()];
   72|   270M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  43.8k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  3.10M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  40.8k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  7.42k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  7.42k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  7.42k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  7.42k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  15.5k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  15.5k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT>& arg) {
   56|  15.5k|    vector_.swap(arg.vector_);
   57|  15.5k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  15.5k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  15.5k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT>& arg) {
   56|  15.5k|    vector_.swap(arg.vector_);
   57|  15.5k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  7.41k|  void assign(size_t size, const ValueTypeT& val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  7.41k|  void assign(size_t size, const ValueTypeT& val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  7.41k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  10.1k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  42.8k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  80.7k|int32_t DataTypeLength(DataType dt) {
   20|  80.7k|  switch (dt) {
   21|  27.3k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 27.3k, False: 53.4k]
  ------------------
   22|  32.9k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 5.63k, False: 75.1k]
  ------------------
   23|  32.9k|      return 1;
   24|  6.26k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 6.26k, False: 74.5k]
  ------------------
   25|  8.26k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 2.00k, False: 78.7k]
  ------------------
   26|  8.26k|      return 2;
   27|  32.1k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 32.1k, False: 48.5k]
  ------------------
   28|  34.2k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 2.08k, False: 78.6k]
  ------------------
   29|  34.2k|      return 4;
   30|    134|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 134, False: 80.6k]
  ------------------
   31|    414|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 280, False: 80.4k]
  ------------------
   32|    414|      return 8;
   33|  4.33k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 4.33k, False: 76.4k]
  ------------------
   34|  4.33k|      return 4;
   35|    272|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 272, False: 80.4k]
  ------------------
   36|    272|      return 8;
   37|    224|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 224, False: 80.5k]
  ------------------
   38|    224|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 80.7k]
  ------------------
   40|      0|      return -1;
   41|  80.7k|  }
   42|  80.7k|}

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

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  2.15k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  10.1k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|      2|  StatusOr(const Status& status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  12.2k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  12.2k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|      2|  const Status& status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  10.7k|  StatusOr(const Status& status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  12.2k|  T&& value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.51k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  2.15k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  2.15k|  T&& value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  10.1k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  10.1k|  T&& value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   757k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|   757k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 757k, Folded]
  ------------------
   65|   757k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 997, False: 756k]
  ------------------
   66|    997|      return false;
   67|    997|    }
   68|   757k|  } 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|   756k|  return true;
   77|   757k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   525k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|   525k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   525k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 93, False: 525k]
  ------------------
   33|     93|    return false;
   34|     93|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   525k|  uint8_t in;
   39|   525k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 625, False: 524k]
  ------------------
   40|    625|    return false;
   41|    625|  }
   42|   524k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 25.0k, False: 499k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  25.0k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 550, False: 24.5k]
  ------------------
   45|    550|      return false;
   46|    550|    }
   47|       |    // Append decoded info from this byte.
   48|  24.5k|    *out_val <<= 7;
   49|  24.5k|    *out_val |= in & ((1 << 7) - 1);
   50|   499k|  } else {
   51|       |    // Last byte reached
   52|   499k|    *out_val = in;
   53|   499k|  }
   54|   524k|  return true;
   55|   524k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.82k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  6.82k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.82k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 6.82k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.82k|  uint8_t in;
   39|  6.82k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 5, False: 6.81k]
  ------------------
   40|      5|    return false;
   41|      5|  }
   42|  6.81k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 778, False: 6.03k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    778|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 13, False: 765]
  ------------------
   45|     13|      return false;
   46|     13|    }
   47|       |    // Append decoded info from this byte.
   48|    765|    *out_val <<= 7;
   49|    765|    *out_val |= in & ((1 << 7) - 1);
   50|  6.03k|  } else {
   51|       |    // Last byte reached
   52|  6.03k|    *out_val = in;
   53|  6.03k|  }
   54|  6.80k|  return true;
   55|  6.81k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  7.98k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|  7.98k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 7.98k, Folded]
  ------------------
   65|  7.98k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 100, False: 7.88k]
  ------------------
   66|    100|      return false;
   67|    100|    }
   68|  7.98k|  } 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|  7.88k|  return true;
   77|  7.98k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.67k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  4.67k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.67k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 4.67k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.67k|  uint8_t in;
   39|  4.67k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 12, False: 4.66k]
  ------------------
   40|     12|    return false;
   41|     12|  }
   42|  4.66k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 107, False: 4.55k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    107|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 1, False: 106]
  ------------------
   45|      1|      return false;
   46|      1|    }
   47|       |    // Append decoded info from this byte.
   48|    106|    *out_val <<= 7;
   49|    106|    *out_val |= in & ((1 << 7) - 1);
   50|  4.55k|  } else {
   51|       |    // Last byte reached
   52|  4.55k|    *out_val = in;
   53|  4.55k|  }
   54|  4.65k|  return true;
   55|  4.66k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   165k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|   165k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   165k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 22, False: 165k]
  ------------------
   33|     22|    return false;
   34|     22|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   165k|  uint8_t in;
   39|   165k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 84, False: 165k]
  ------------------
   40|     84|    return false;
   41|     84|  }
   42|   165k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.51k, False: 164k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.51k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 121, False: 1.39k]
  ------------------
   45|    121|      return false;
   46|    121|    }
   47|       |    // Append decoded info from this byte.
   48|  1.39k|    *out_val <<= 7;
   49|  1.39k|    *out_val |= in & ((1 << 7) - 1);
   50|   164k|  } else {
   51|       |    // Last byte reached
   52|   164k|    *out_val = in;
   53|   164k|  }
   54|   165k|  return true;
   55|   165k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  7.92k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|  7.92k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 7.92k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  7.92k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  7.92k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  7.92k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 63, False: 7.85k]
  ------------------
   72|     63|      return false;
   73|     63|    }
   74|  7.85k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  7.85k|  }
   76|  7.85k|  return true;
   77|  7.92k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  9.44k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  9.44k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  9.44k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 21, False: 9.42k]
  ------------------
   33|     21|    return false;
   34|     21|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  9.42k|  uint8_t in;
   39|  9.42k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 42, False: 9.38k]
  ------------------
   40|     42|    return false;
   41|     42|  }
   42|  9.38k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.52k, False: 7.85k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.52k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 116, False: 1.41k]
  ------------------
   45|    116|      return false;
   46|    116|    }
   47|       |    // Append decoded info from this byte.
   48|  1.41k|    *out_val <<= 7;
   49|  1.41k|    *out_val |= in & ((1 << 7) - 1);
   50|  7.85k|  } else {
   51|       |    // Last byte reached
   52|  7.85k|    *out_val = in;
   53|  7.85k|  }
   54|  9.27k|  return true;
   55|  9.38k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  5.39k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  5.39k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  5.39k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 5.38k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  5.38k|  uint8_t in;
   39|  5.38k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 26, False: 5.36k]
  ------------------
   40|     26|    return false;
   41|     26|  }
   42|  5.36k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.08k, False: 4.27k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.08k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 35, False: 1.05k]
  ------------------
   45|     35|      return false;
   46|     35|    }
   47|       |    // Append decoded info from this byte.
   48|  1.05k|    *out_val <<= 7;
   49|  1.05k|    *out_val |= in & ((1 << 7) - 1);
   50|  4.27k|  } else {
   51|       |    // Last byte reached
   52|  4.27k|    *out_val = in;
   53|  4.27k|  }
   54|  5.32k|  return true;
   55|  5.36k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  32.7k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  32.7k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  32.7k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 32.7k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  32.7k|  uint8_t in;
   39|  32.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 15, False: 32.7k]
  ------------------
   40|     15|    return false;
   41|     15|  }
   42|  32.7k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 565, False: 32.1k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    565|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 21, False: 544]
  ------------------
   45|     21|      return false;
   46|     21|    }
   47|       |    // Append decoded info from this byte.
   48|    544|    *out_val <<= 7;
   49|    544|    *out_val |= in & ((1 << 7) - 1);
   50|  32.1k|  } else {
   51|       |    // Last byte reached
   52|  32.1k|    *out_val = in;
   53|  32.1k|  }
   54|  32.7k|  return true;
   55|  32.7k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.53k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  8.53k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.53k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 56, False: 8.47k]
  ------------------
   33|     56|    return false;
   34|     56|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.47k|  uint8_t in;
   39|  8.47k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 47, False: 8.42k]
  ------------------
   40|     47|    return false;
   41|     47|  }
   42|  8.42k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.06k, False: 6.36k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.06k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 286, False: 1.77k]
  ------------------
   45|    286|      return false;
   46|    286|    }
   47|       |    // Append decoded info from this byte.
   48|  1.77k|    *out_val <<= 7;
   49|  1.77k|    *out_val |= in & ((1 << 7) - 1);
   50|  6.36k|  } else {
   51|       |    // Last byte reached
   52|  6.36k|    *out_val = in;
   53|  6.36k|  }
   54|  8.14k|  return true;
   55|  8.42k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  6.21k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  6.21k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.21k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 54, False: 6.16k]
  ------------------
   33|     54|    return false;
   34|     54|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.16k|  uint8_t in;
   39|  6.16k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 34, False: 6.12k]
  ------------------
   40|     34|    return false;
   41|     34|  }
   42|  6.12k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.79k, False: 3.33k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.79k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 563, False: 2.22k]
  ------------------
   45|    563|      return false;
   46|    563|    }
   47|       |    // Append decoded info from this byte.
   48|  2.22k|    *out_val <<= 7;
   49|  2.22k|    *out_val |= in & ((1 << 7) - 1);
   50|  3.33k|  } else {
   51|       |    // Last byte reached
   52|  3.33k|    *out_val = in;
   53|  3.33k|  }
   54|  5.56k|  return true;
   55|  6.12k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  48.3k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  48.3k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  48.3k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 48.3k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  48.3k|  uint8_t in;
   39|  48.3k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 8, False: 48.3k]
  ------------------
   40|      8|    return false;
   41|      8|  }
   42|  48.3k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 5.12k, False: 43.1k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  5.12k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 35, False: 5.09k]
  ------------------
   45|     35|      return false;
   46|     35|    }
   47|       |    // Append decoded info from this byte.
   48|  5.09k|    *out_val <<= 7;
   49|  5.09k|    *out_val |= in & ((1 << 7) - 1);
   50|  43.1k|  } else {
   51|       |    // Last byte reached
   52|  43.1k|    *out_val = in;
   53|  43.1k|  }
   54|  48.2k|  return true;
   55|  48.3k|}

_ZN5draco7VectorDIfLi3EEC2Ev:
   42|  53.5k|  VectorD() {
   43|   214k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 160k, False: 53.5k]
  ------------------
   44|   160k|      (*this)[i] = Scalar(0);
   45|   160k|    }
   46|  53.5k|  }
_ZN5draco7VectorDIfLi3EEixEi:
  114|   258k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEixEi:
  115|   203k|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEixEi:
  114|   753M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   61|     85|      : v_({{c0, c1, c2}}) {
   62|     85|    DRACO_DCHECK_EQ(dimension, 3);
   63|     85|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  115|   136M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  139|  15.1M|  Self operator-(const Self& o) const {
  140|  15.1M|    Self ret;
  141|  60.4M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 45.3M, False: 15.1M]
  ------------------
  142|  45.3M|      ret[i] = (*this)[i] - o[i];
  143|  45.3M|    }
  144|  15.1M|    return ret;
  145|  15.1M|  }
_ZN5draco12CrossProductIlTnPNSt3__19enable_ifIXaasr3std11is_integralIT_EE5valuesr3std9is_signedIS3_EE5valueEvE4typeELPv0EEENS_7VectorDIS3_Li3EEERKS9_SB_:
  325|  7.53M|                                 const VectorD<ScalarT, 3>& v) {
  326|       |  // Preventing accidental use with uint32_t and the like.
  327|  7.53M|  static_assert(std::is_signed<ScalarT>::value,
  328|  7.53M|                "ScalarT must be a signed type. ");
  329|  7.53M|  VectorD<ScalarT, 3> r;
  330|  7.53M|  typedef typename std::make_unsigned<ScalarT>::type ScalarUT;
  331|  7.53M|  const ScalarUT u0 = static_cast<ScalarUT>(u[0]);
  332|  7.53M|  const ScalarUT u1 = static_cast<ScalarUT>(u[1]);
  333|  7.53M|  const ScalarUT u2 = static_cast<ScalarUT>(u[2]);
  334|  7.53M|  const ScalarUT v0 = static_cast<ScalarUT>(v[0]);
  335|  7.53M|  const ScalarUT v1 = static_cast<ScalarUT>(v[1]);
  336|  7.53M|  const ScalarUT v2 = static_cast<ScalarUT>(v[2]);
  337|  7.53M|  r[0] = static_cast<ScalarT>((u1 * v2) - (u2 * v1));
  338|  7.53M|  r[1] = static_cast<ScalarT>((u2 * v0) - (u0 * v2));
  339|  7.53M|  r[2] = static_cast<ScalarT>((u0 * v1) - (u1 * v0));
  340|  7.53M|  return r;
  341|  7.53M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  284|  7.53M|  Scalar* data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  285|  7.53M|  const Scalar* data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  239|  4.13M|  Scalar AbsSum() const {
  240|  4.13M|    Scalar result(0);
  241|  16.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (241:21): [True: 12.3M, False: 4.12M]
  ------------------
  242|  12.3M|      Scalar next_value = std::abs(v_[i]);
  243|  12.3M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (243:11): [True: 12.0k, False: 12.3M]
  ------------------
  244|       |        // Return the max if adding would have caused an overflow.
  245|  12.0k|        return std::numeric_limits<Scalar>::max();
  246|  12.0k|      }
  247|  12.3M|      result += next_value;
  248|  12.3M|    }
  249|  4.12M|    return result;
  250|  4.13M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  184|   210k|  Self operator/(const Scalar& o) const {
  185|   210k|    Self ret;
  186|   842k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (186:21): [True: 632k, False: 210k]
  ------------------
  187|   632k|      ret[i] = (*this)[i] / o;
  188|   632k|    }
  189|   210k|    return ret;
  190|   210k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  114|   239M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  114|  22.5M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  284|  12.4M|  Scalar* data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  122|  3.76M|  Self operator-() const {
  123|  3.76M|    Self ret;
  124|  15.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (124:21): [True: 11.2M, False: 3.76M]
  ------------------
  125|  11.2M|      ret[i] = -(*this)[i];
  126|  11.2M|    }
  127|  3.76M|    return ret;
  128|  3.76M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  115|  11.2M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  139|  20.1M|  Self operator-(const Self& o) const {
  140|  20.1M|    Self ret;
  141|  60.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 40.2M, False: 20.1M]
  ------------------
  142|  40.2M|      ret[i] = (*this)[i] - o[i];
  143|  40.2M|    }
  144|  20.1M|    return ret;
  145|  20.1M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  114|   241M|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  115|   362M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  114|   268M|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  131|  40.2M|  Self operator+(const Self& o) const {
  132|  40.2M|    Self ret;
  133|   120M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 80.4M, False: 40.2M]
  ------------------
  134|  80.4M|      ret[i] = (*this)[i] + o[i];
  135|  80.4M|    }
  136|  40.2M|    return ret;
  137|  40.2M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  115|   341M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  139|  1.00M|  Self operator-(const Self& o) const {
  140|  1.00M|    Self ret;
  141|  3.01M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 2.00M, False: 1.00M]
  ------------------
  142|  2.00M|      ret[i] = (*this)[i] - o[i];
  143|  2.00M|    }
  144|  1.00M|    return ret;
  145|  1.00M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  131|  1.00M|  Self operator+(const Self& o) const {
  132|  1.00M|    Self ret;
  133|  3.01M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 2.00M, False: 1.00M]
  ------------------
  134|  2.00M|      ret[i] = (*this)[i] + o[i];
  135|  2.00M|    }
  136|  1.00M|    return ret;
  137|  1.00M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  208|   719k|  bool operator==(const Self& o) const {
  209|  2.13M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (209:21): [True: 1.42M, False: 708k]
  ------------------
  210|  1.42M|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (210:11): [True: 10.4k, False: 1.41M]
  ------------------
  211|  10.4k|        return false;
  212|  10.4k|      }
  213|  1.42M|    }
  214|   708k|    return true;
  215|   719k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  115|  8.63M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  139|  21.5k|  Self operator-(const Self& o) const {
  140|  21.5k|    Self ret;
  141|  86.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 64.6k, False: 21.5k]
  ------------------
  142|  64.6k|      ret[i] = (*this)[i] - o[i];
  143|  64.6k|    }
  144|  21.5k|    return ret;
  145|  21.5k|  }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  236|  11.1k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  252|  11.9k|  Scalar Dot(const Self& o) const {
  253|  11.9k|    Scalar ret(0);
  254|  47.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (254:21): [True: 35.7k, False: 11.9k]
  ------------------
  255|  35.7k|      ret += (*this)[i] * o[i];
  256|  35.7k|    }
  257|  11.9k|    return ret;
  258|  11.9k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  176|    752|  Self operator*(const Scalar& o) const {
  177|    752|    Self ret;
  178|  3.00k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 2.25k, False: 752]
  ------------------
  179|  2.25k|      ret[i] = (*this)[i] * o;
  180|  2.25k|    }
  181|    752|    return ret;
  182|    752|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  139|  10.4k|  Self operator-(const Self& o) const {
  140|  10.4k|    Self ret;
  141|  31.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 20.8k, False: 10.4k]
  ------------------
  142|  20.8k|      ret[i] = (*this)[i] - o[i];
  143|  20.8k|    }
  144|  10.4k|    return ret;
  145|  10.4k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   42|  20.8k|  VectorD() {
   43|  62.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 41.6k, False: 20.8k]
  ------------------
   44|  41.6k|      (*this)[i] = Scalar(0);
   45|  41.6k|    }
   46|  20.8k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   54|  1.44M|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|  1.44M|    DRACO_DCHECK_EQ(dimension, 2);
   56|  1.44M|    v_[0] = c0;
   57|  1.44M|    v_[1] = c1;
   58|  1.44M|  }
_ZN5draco7VectorDIfLi2EEixEi:
  114|  83.0k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  208|   642k|  bool operator==(const Self& o) const {
  209|  1.81M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (209:21): [True: 1.23M, False: 587k]
  ------------------
  210|  1.23M|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (210:11): [True: 54.5k, False: 1.17M]
  ------------------
  211|  54.5k|        return false;
  212|  54.5k|      }
  213|  1.23M|    }
  214|   587k|    return true;
  215|   642k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  115|  3.66M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   42|  46.3M|  VectorD() {
   43|   185M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 139M, False: 46.3M]
  ------------------
   44|   139M|      (*this)[i] = Scalar(0);
   45|   139M|    }
   46|  46.3M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  236|  55.7k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  252|  56.9k|  Scalar Dot(const Self& o) const {
  253|  56.9k|    Scalar ret(0);
  254|   227k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (254:21): [True: 170k, False: 56.9k]
  ------------------
  255|   170k|      ret += (*this)[i] * o[i];
  256|   170k|    }
  257|  56.9k|    return ret;
  258|  56.9k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  139|  1.22k|  Self operator-(const Self& o) const {
  140|  1.22k|    Self ret;
  141|  3.66k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 2.44k, False: 1.22k]
  ------------------
  142|  2.44k|      ret[i] = (*this)[i] - o[i];
  143|  2.44k|    }
  144|  1.22k|    return ret;
  145|  1.22k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  104|  4.49k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  13.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 8.98k, False: 4.49k]
  ------------------
  106|  8.98k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 8.98k, False: 0]
  ------------------
  107|  8.98k|        v_[i] = Scalar(src_vector[i]);
  108|  8.98k|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  8.98k|    }
  112|  4.49k|  }
_ZNK5draco7VectorDImLi2EEmlERKm:
  176|  2.34k|  Self operator*(const Scalar& o) const {
  177|  2.34k|    Self ret;
  178|  7.02k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 4.68k, False: 2.34k]
  ------------------
  179|  4.68k|      ret[i] = (*this)[i] * o;
  180|  4.68k|    }
  181|  2.34k|    return ret;
  182|  2.34k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   42|  4.58k|  VectorD() {
   43|  13.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 9.17k, False: 4.58k]
  ------------------
   44|  9.17k|      (*this)[i] = Scalar(0);
   45|  9.17k|    }
   46|  4.58k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  115|  18.1k|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  114|  18.3k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  131|  1.80k|  Self operator+(const Self& o) const {
  132|  1.80k|    Self ret;
  133|  5.42k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 3.61k, False: 1.80k]
  ------------------
  134|  3.61k|      ret[i] = (*this)[i] + o[i];
  135|  3.61k|    }
  136|  1.80k|    return ret;
  137|  1.80k|  }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  104|  2.24k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  6.73k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 4.49k, False: 2.24k]
  ------------------
  106|  4.49k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 4.49k, False: 0]
  ------------------
  107|  4.49k|        v_[i] = Scalar(src_vector[i]);
  108|  4.49k|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  4.49k|    }
  112|  2.24k|  }
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  131|  1.16k|  Self operator+(const Self& o) const {
  132|  1.16k|    Self ret;
  133|  4.64k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 3.48k, False: 1.16k]
  ------------------
  134|  3.48k|      ret[i] = (*this)[i] + o[i];
  135|  3.48k|    }
  136|  1.16k|    return ret;
  137|  1.16k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  294|  1.16k|    const ScalarT& o, const VectorD<ScalarT, dimension_t>& v) {
  295|  1.16k|  return v * o;
  296|  1.16k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  176|  1.16k|  Self operator*(const Scalar& o) const {
  177|  1.16k|    Self ret;
  178|  4.64k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 3.48k, False: 1.16k]
  ------------------
  179|  3.48k|      ret[i] = (*this)[i] * o;
  180|  3.48k|    }
  181|  1.16k|    return ret;
  182|  1.16k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   54|  1.28M|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|  1.28M|    DRACO_DCHECK_EQ(dimension, 2);
   56|  1.28M|    v_[0] = c0;
   57|  1.28M|    v_[1] = c1;
   58|  1.28M|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  176|  1.16k|  Self operator*(const Scalar& o) const {
  177|  1.16k|    Self ret;
  178|  3.48k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 2.32k, False: 1.16k]
  ------------------
  179|  2.32k|      ret[i] = (*this)[i] * o;
  180|  2.32k|    }
  181|  1.16k|    return ret;
  182|  1.16k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   42|  4.61k|  VectorD() {
   43|  13.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 9.23k, False: 4.61k]
  ------------------
   44|  9.23k|      (*this)[i] = Scalar(0);
   45|  9.23k|    }
   46|  4.61k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  184|  1.07k|  Self operator/(const Scalar& o) const {
  185|  1.07k|    Self ret;
  186|  3.22k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (186:21): [True: 2.15k, False: 1.07k]
  ------------------
  187|  2.15k|      ret[i] = (*this)[i] / o;
  188|  2.15k|    }
  189|  1.07k|    return ret;
  190|  1.07k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  139|    437|  Self operator-(const Self& o) const {
  140|    437|    Self ret;
  141|  1.31k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 874, False: 437]
  ------------------
  142|    874|      ret[i] = (*this)[i] - o[i];
  143|    874|    }
  144|    437|    return ret;
  145|    437|  }
_ZN5draco7VectorDIlLi2EEixEi:
  114|  18.3k|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   42|  3.76M|  VectorD() {
   43|  15.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 11.3M, False: 3.76M]
  ------------------
   44|  11.3M|      (*this)[i] = Scalar(0);
   45|  11.3M|    }
   46|  3.76M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   54|  65.0M|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|  65.0M|    DRACO_DCHECK_EQ(dimension, 2);
   56|  65.0M|    v_[0] = c0;
   57|  65.0M|    v_[1] = c1;
   58|  65.0M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  104|   120M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|   362M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 241M, False: 120M]
  ------------------
  106|   241M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 241M, False: 0]
  ------------------
  107|   241M|        v_[i] = Scalar(src_vector[i]);
  108|   241M|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|   241M|    }
  112|   120M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   42|  60.3M|  VectorD() {
   43|   181M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 120M, False: 60.3M]
  ------------------
   44|   120M|      (*this)[i] = Scalar(0);
   45|   120M|    }
   46|  60.3M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  104|  60.3M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|   181M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 120M, False: 60.3M]
  ------------------
  106|   120M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 120M, False: 0]
  ------------------
  107|   120M|        v_[i] = Scalar(src_vector[i]);
  108|   120M|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|   120M|    }
  112|  60.3M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   90|  23.7M|  VectorD(const Self& o) {
   91|  71.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (91:21): [True: 47.5M, False: 23.7M]
  ------------------
   92|  47.5M|      (*this)[i] = o[i];
   93|  47.5M|    }
   94|  23.7M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   42|  2.00M|  VectorD() {
   43|  6.02M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 4.01M, False: 2.00M]
  ------------------
   44|  4.01M|      (*this)[i] = Scalar(0);
   45|  4.01M|    }
   46|  2.00M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   90|   251M|  VectorD(const Self& o) {
   91|  1.00G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (91:21): [True: 753M, False: 251M]
  ------------------
   92|   753M|      (*this)[i] = o[i];
   93|   753M|    }
   94|   251M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  115|   753M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   61|   116M|      : v_({{c0, c1, c2}}) {
   62|   116M|    DRACO_DCHECK_EQ(dimension, 3);
   63|   116M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   118M|  inline int num_vertices() const {
   74|   118M|    return static_cast<int>(vertex_corners_.size());
   75|   118M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  14.1M|  inline int num_corners() const {
   77|  14.1M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  14.1M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  4.50M|  inline int num_faces() const {
   80|  4.50M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  4.50M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   404M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   404M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 404M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   404M|    return opposite_corners_[corner];
   88|   404M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   664M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   664M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 17.7M, False: 646M]
  ------------------
   91|  17.7M|      return corner;
   92|  17.7M|    }
   93|   646M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 575M, False: 71.1M]
  ------------------
   94|   664M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   587M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   587M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 7.62M, False: 579M]
  ------------------
   97|  7.62M|      return corner;
   98|  7.62M|    }
   99|   579M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 178M, False: 401M]
  ------------------
  100|   587M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.01G|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  1.01G|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1.01G]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  1.01G|    return ConfidentVertex(corner);
  106|  1.01G|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  1.01G|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  1.01G|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  1.01G|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  1.01G|    return corner_to_vertex_map_[corner];
  111|  1.01G|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  56.2M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  56.2M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 56.2M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  56.2M|    return FaceIndex(corner.value() / 3);
  117|  56.2M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.22G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  70.1M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  70.1M|    return vertex_corners_[v];
  152|  70.1M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  2.01M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  2.01M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  2.01M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 54.4k, False: 1.95M]
  ------------------
  188|  54.4k|      return true;
  189|  54.4k|    }
  190|  1.95M|    return false;
  191|  2.01M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|   103M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|   103M|    return Previous(Opposite(Previous(corner)));
  202|   103M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  22.2M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  22.2M|    return Next(Opposite(Next(corner)));
  207|  22.2M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  5.12M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  5.12M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 5.12M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  5.12M|    return Opposite(Previous(corner_id));
  222|  5.12M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  7.08M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  7.08M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 7.08M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  7.08M|    return Opposite(Next(corner_id));
  228|  7.08M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   381M|                                CornerIndex opp_corner_id) {
  249|   381M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   381M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   381M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   464M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   464M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   464M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   464M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   124M|  VertexIndex AddNewVertex() {
  271|   124M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   124M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   124M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   124M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   259M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   259M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   259M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 259M, False: 0]
  ------------------
  295|   259M|      vertex_corners_[vert] = corner;
  296|   259M|    }
  297|   259M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  1.02M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  1.02M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  1.02M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  1.02M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  2.49k|      : corner_table_(table),
  229|  2.49k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  2.49k|        corner_(start_corner_),
  231|  2.49k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.76M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  8.21k|  VertexCornersIterator& operator++() {
  268|  8.21k|    Next();
  269|  8.21k|    return *this;
  270|  8.21k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.21M|  void Next() {
  248|  3.21M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.19M, False: 25.3k]
  ------------------
  249|  3.19M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.19M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 25.6k, False: 3.16M]
  ------------------
  251|       |        // Open boundary reached.
  252|  25.6k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  25.6k|        left_traversal_ = false;
  254|  3.16M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 527k, False: 2.63M]
  ------------------
  255|       |        // End reached.
  256|   527k|        corner_ = kInvalidCornerIndex;
  257|   527k|      }
  258|  3.19M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  25.3k|      corner_ = corner_table_->SwingRight(corner_);
  262|  25.3k|    }
  263|  3.21M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.42M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  7.90M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  8.64M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  4.32M|  void Next() {
  248|  4.32M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 4.28M, False: 40.3k]
  ------------------
  249|  4.28M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  4.28M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 3.44M, False: 835k]
  ------------------
  251|       |        // Open boundary reached.
  252|  3.44M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  3.44M|        left_traversal_ = false;
  254|  3.44M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 134k, False: 700k]
  ------------------
  255|       |        // End reached.
  256|   134k|        corner_ = kInvalidCornerIndex;
  257|   134k|      }
  258|  4.28M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  40.3k|      corner_ = corner_table_->SwingRight(corner_);
  262|  40.3k|    }
  263|  4.32M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  3.58M|      : corner_table_(table),
  236|  3.58M|        start_corner_(corner_id),
  237|  3.58M|        corner_(start_corner_),
  238|  3.58M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   550k|      : corner_table_(table),
  236|   550k|        start_corner_(corner_id),
  237|   550k|        corner_(start_corner_),
  238|   550k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  82.1M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  82.1M|    return is_edge_on_seam_[corner.value()];
   47|  82.1M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  41.3M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  41.3M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 41.3M]
  |  Branch (50:42): [True: 35.9M, False: 5.38M]
  ------------------
   51|  35.9M|      return kInvalidCornerIndex;
   52|  35.9M|    }
   53|  5.38M|    return corner_table_->Opposite(corner);
   54|  41.3M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  58.2M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  58.2M|    return corner_table_->Next(corner);
   58|  58.2M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  35.2M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  35.2M|    return corner_table_->Previous(corner);
   62|  35.2M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  6.89M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  6.89M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  6.89M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  4.82M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  4.82M|    return Opposite(Previous(corner));
   73|  4.82M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  5.35M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  5.35M|    return Opposite(Next(corner));
   76|  5.35M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  7.26M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  7.26M|    return Previous(Opposite(Previous(corner)));
   81|  7.26M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  18.4M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  18.4M|    return Next(Opposite(Next(corner)));
   86|  18.4M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  12.1k|  int num_vertices() const {
   89|  12.1k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  12.1k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  4.01k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.84k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   143M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   143M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   143M|    return ConfidentVertex(corner);
   97|   143M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   143M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   143M|    return corner_to_vertex_map_[corner.value()];
  100|   143M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  4.80M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  4.80M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  4.80M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  4.80M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  4.80M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  4.80M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 4.80M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  4.80M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 4.27M, False: 534k]
  ------------------
  128|  4.27M|      return true;
  129|  4.27M|    }
  130|   534k|    return false;
  131|  4.80M|  }

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

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

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

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

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

_ZN5draco15MetadataDecoderC2Ev:
   23|    660|MetadataDecoder::MetadataDecoder() : buffer_(nullptr) {}
_ZN5draco15MetadataDecoder22DecodeGeometryMetadataEPNS_13DecoderBufferEPNS_16GeometryMetadataE:
   35|    660|                                             GeometryMetadata* metadata) {
   36|    660|  if (!metadata) {
  ------------------
  |  Branch (36:7): [True: 0, False: 660]
  ------------------
   37|      0|    return false;
   38|      0|  }
   39|    660|  buffer_ = in_buffer;
   40|    660|  uint32_t num_att_metadata = 0;
   41|    660|  if (!DecodeVarint(&num_att_metadata, buffer_)) {
  ------------------
  |  Branch (41:7): [True: 0, False: 660]
  ------------------
   42|      0|    return false;
   43|      0|  }
   44|       |  // Decode attribute metadata.
   45|  1.59k|  for (uint32_t i = 0; i < num_att_metadata; ++i) {
  ------------------
  |  Branch (45:24): [True: 1.39k, False: 200]
  ------------------
   46|  1.39k|    uint32_t att_unique_id;
   47|  1.39k|    if (!DecodeVarint(&att_unique_id, buffer_)) {
  ------------------
  |  Branch (47:9): [True: 5, False: 1.38k]
  ------------------
   48|      5|      return false;
   49|      5|    }
   50|  1.38k|    std::unique_ptr<AttributeMetadata> att_metadata =
   51|  1.38k|        std::unique_ptr<AttributeMetadata>(new AttributeMetadata());
   52|  1.38k|    att_metadata->set_att_unique_id(att_unique_id);
   53|  1.38k|    if (!DecodeMetadata(static_cast<Metadata*>(att_metadata.get()))) {
  ------------------
  |  Branch (53:9): [True: 455, False: 932]
  ------------------
   54|    455|      return false;
   55|    455|    }
   56|    932|    metadata->AddAttributeMetadata(std::move(att_metadata));
   57|    932|  }
   58|    200|  return DecodeMetadata(static_cast<Metadata*>(metadata));
   59|    660|}
_ZN5draco15MetadataDecoder14DecodeMetadataEPNS_8MetadataE:
   61|  1.58k|bool MetadataDecoder::DecodeMetadata(Metadata* metadata) {
   62|       |  // Limit metadata nesting depth to avoid stack overflow in destructor.
   63|  1.58k|  constexpr int kMaxSubmetadataLevel = 1000;
   64|       |
   65|  1.58k|  struct MetadataTuple {
   66|  1.58k|    Metadata* parent_metadata;
   67|  1.58k|    Metadata* decoded_metadata;
   68|  1.58k|    int level;
   69|  1.58k|  };
   70|  1.58k|  std::vector<MetadataTuple> metadata_stack;
   71|  1.58k|  metadata_stack.push_back({nullptr, metadata, 0});
   72|  50.4k|  while (!metadata_stack.empty()) {
  ------------------
  |  Branch (72:10): [True: 49.5k, False: 939]
  ------------------
   73|  49.5k|    const MetadataTuple mp = metadata_stack.back();
   74|  49.5k|    metadata_stack.pop_back();
   75|  49.5k|    metadata = mp.decoded_metadata;
   76|       |
   77|  49.5k|    if (mp.parent_metadata != nullptr) {
  ------------------
  |  Branch (77:9): [True: 47.9k, False: 1.58k]
  ------------------
   78|  47.9k|      if (mp.level > kMaxSubmetadataLevel) {
  ------------------
  |  Branch (78:11): [True: 2, False: 47.9k]
  ------------------
   79|      2|        return false;
   80|      2|      }
   81|  47.9k|      std::string sub_metadata_name;
   82|  47.9k|      if (!DecodeName(&sub_metadata_name)) {
  ------------------
  |  Branch (82:11): [True: 27, False: 47.9k]
  ------------------
   83|     27|        return false;
   84|     27|      }
   85|  47.9k|      std::unique_ptr<Metadata> sub_metadata =
   86|  47.9k|          std::unique_ptr<Metadata>(new Metadata());
   87|  47.9k|      metadata = sub_metadata.get();
   88|  47.9k|      if (!mp.parent_metadata->AddSubMetadata(sub_metadata_name,
  ------------------
  |  Branch (88:11): [True: 19, False: 47.9k]
  ------------------
   89|  47.9k|                                              std::move(sub_metadata))) {
   90|     19|        return false;
   91|     19|      }
   92|  47.9k|    }
   93|  49.5k|    if (metadata == nullptr) {
  ------------------
  |  Branch (93:9): [True: 0, False: 49.5k]
  ------------------
   94|      0|      return false;
   95|      0|    }
   96|       |
   97|  49.5k|    uint32_t num_entries = 0;
   98|  49.5k|    if (!DecodeVarint(&num_entries, buffer_)) {
  ------------------
  |  Branch (98:9): [True: 28, False: 49.4k]
  ------------------
   99|     28|      return false;
  100|     28|    }
  101|   112k|    for (uint32_t i = 0; i < num_entries; ++i) {
  ------------------
  |  Branch (101:26): [True: 63.9k, False: 48.9k]
  ------------------
  102|  63.9k|      if (!DecodeEntry(metadata)) {
  ------------------
  |  Branch (102:11): [True: 502, False: 63.4k]
  ------------------
  103|    502|        return false;
  104|    502|      }
  105|  63.9k|    }
  106|  48.9k|    uint32_t num_sub_metadata = 0;
  107|  48.9k|    if (!DecodeVarint(&num_sub_metadata, buffer_)) {
  ------------------
  |  Branch (107:9): [True: 12, False: 48.9k]
  ------------------
  108|     12|      return false;
  109|     12|    }
  110|  48.9k|    if (num_sub_metadata > buffer_->remaining_size()) {
  ------------------
  |  Branch (110:9): [True: 58, False: 48.9k]
  ------------------
  111|       |      // The decoded number of metadata items is unreasonably high.
  112|     58|      return false;
  113|     58|    }
  114|   316k|    for (uint32_t i = 0; i < num_sub_metadata; ++i) {
  ------------------
  |  Branch (114:26): [True: 268k, False: 48.9k]
  ------------------
  115|   268k|      metadata_stack.push_back(
  116|   268k|          {metadata, nullptr, mp.parent_metadata ? mp.level + 1 : mp.level});
  ------------------
  |  Branch (116:31): [True: 260k, False: 7.39k]
  ------------------
  117|   268k|    }
  118|  48.9k|  }
  119|    939|  return true;
  120|  1.58k|}
_ZN5draco15MetadataDecoder11DecodeEntryEPNS_8MetadataE:
  122|  63.9k|bool MetadataDecoder::DecodeEntry(Metadata* metadata) {
  123|  63.9k|  std::string entry_name;
  124|  63.9k|  if (!DecodeName(&entry_name)) {
  ------------------
  |  Branch (124:7): [True: 220, False: 63.7k]
  ------------------
  125|    220|    return false;
  126|    220|  }
  127|  63.7k|  uint32_t data_size = 0;
  128|  63.7k|  if (!DecodeVarint(&data_size, buffer_)) {
  ------------------
  |  Branch (128:7): [True: 61, False: 63.6k]
  ------------------
  129|     61|    return false;
  130|     61|  }
  131|  63.6k|  if (data_size == 0) {
  ------------------
  |  Branch (131:7): [True: 91, False: 63.5k]
  ------------------
  132|     91|    return false;
  133|     91|  }
  134|  63.5k|  if (data_size > buffer_->remaining_size()) {
  ------------------
  |  Branch (134:7): [True: 130, False: 63.4k]
  ------------------
  135|    130|    return false;
  136|    130|  }
  137|  63.4k|  std::vector<uint8_t> entry_value(data_size);
  138|  63.4k|  if (!buffer_->Decode(&entry_value[0], data_size)) {
  ------------------
  |  Branch (138:7): [True: 0, False: 63.4k]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|  63.4k|  metadata->AddEntryBinary(entry_name, entry_value);
  142|  63.4k|  return true;
  143|  63.4k|}
_ZN5draco15MetadataDecoder10DecodeNameEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  145|   111k|bool MetadataDecoder::DecodeName(std::string* name) {
  146|   111k|  uint8_t name_len = 0;
  147|   111k|  if (!buffer_->Decode(&name_len)) {
  ------------------
  |  Branch (147:7): [True: 47, False: 111k]
  ------------------
  148|     47|    return false;
  149|     47|  }
  150|   111k|  name->resize(name_len);
  151|   111k|  if (name_len == 0) {
  ------------------
  |  Branch (151:7): [True: 25.5k, False: 86.2k]
  ------------------
  152|  25.5k|    return true;
  153|  25.5k|  }
  154|  86.2k|  if (!buffer_->Decode(&name->at(0), name_len)) {
  ------------------
  |  Branch (154:7): [True: 200, False: 86.0k]
  ------------------
  155|    200|    return false;
  156|    200|  }
  157|  86.0k|  return true;
  158|  86.2k|}

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

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

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

