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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.34k|      : quantization_bits_(-1),
   54|  2.34k|        max_quantized_value_(-1),
   55|  2.34k|        max_value_(-1),
   56|  2.34k|        dequantization_scale_(1.f),
   57|  2.34k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.11k|  bool SetQuantizationBits(int32_t q) {
   60|  2.11k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 642, False: 1.47k]
  |  Branch (60:18): [True: 147, False: 1.32k]
  ------------------
   61|    789|      return false;
   62|    789|    }
   63|  1.32k|    quantization_bits_ = q;
   64|  1.32k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.32k|    max_value_ = max_quantized_value_ - 1;
   66|  1.32k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.32k|    center_value_ = max_value_ / 2;
   68|  1.32k|    return true;
   69|  2.11k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.09M|                                           int32_t *out_t) const {
   77|  2.09M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 4.36k, False: 2.09M]
  |  Branch (77:20): [True: 0, False: 4.36k]
  |  Branch (77:32): [True: 4.36k, False: 2.09M]
  |  Branch (77:42): [True: 0, False: 4.36k]
  ------------------
   78|  2.09M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.46M, False: 631k]
  |  Branch (78:29): [True: 4.21k, False: 1.46M]
  ------------------
   79|  4.21k|      s = max_value_;
   80|  4.21k|      t = max_value_;
   81|  2.09M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 4.36k, False: 2.08M]
  |  Branch (81:26): [True: 1.38k, False: 2.98k]
  ------------------
   82|  1.38k|      t = center_value_ - (t - center_value_);
   83|  2.08M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.46M, False: 629k]
  |  Branch (83:35): [True: 4.51k, False: 1.45M]
  ------------------
   84|  4.51k|      t = center_value_ + (center_value_ - t);
   85|  2.08M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.45M, False: 628k]
  |  Branch (85:35): [True: 531, False: 1.45M]
  ------------------
   86|    531|      s = center_value_ + (center_value_ - s);
   87|  2.08M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.26k, False: 2.08M]
  |  Branch (87:26): [True: 1.67k, False: 2.59k]
  ------------------
   88|  1.67k|      s = center_value_ - (s - center_value_);
   89|  1.67k|    }
   90|       |
   91|  2.09M|    *out_s = s;
   92|  2.09M|    *out_t = t;
   93|  2.09M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.09M|                                                       int32_t *out_t) const {
  100|  2.09M|    DRACO_DCHECK_EQ(
  101|  2.09M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.09M|        center_value_);
  103|  2.09M|    int32_t s, t;
  104|  2.09M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.34M, False: 754k]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.34M|      s = (int_vec[1] + center_value_);
  107|  1.34M|      t = (int_vec[2] + center_value_);
  108|  1.34M|    } else {
  109|       |      // Left hemisphere.
  110|   754k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 46.7k, False: 707k]
  ------------------
  111|  46.7k|        s = std::abs(int_vec[2]);
  112|   707k|      } else {
  113|   707k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   707k|      }
  115|   754k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 51.0k, False: 703k]
  ------------------
  116|  51.0k|        t = std::abs(int_vec[1]);
  117|   703k|      } else {
  118|   703k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   703k|      }
  120|   754k|    }
  121|  2.09M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.09M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   126k|                                                    float *out_vector) const {
  199|   126k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   126k|                                 in_t * dequantization_scale_ - 1.f,
  201|   126k|                                 out_vector);
  202|   126k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  1.53M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  1.53M|    DRACO_DCHECK_LE(s, center_value_);
  208|  1.53M|    DRACO_DCHECK_LE(t, center_value_);
  209|  1.53M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  1.53M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  1.53M|    const uint32_t st =
  212|  1.53M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  1.53M|    return st <= center_value_;
  214|  1.53M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  2.01M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  2.01M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  2.01M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  2.01M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  2.01M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  2.01M|    int32_t sign_s = 0;
  223|  2.01M|    int32_t sign_t = 0;
  224|  2.01M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 1.79M, False: 214k]
  |  Branch (224:20): [True: 1.66M, False: 129k]
  ------------------
  225|  1.66M|      sign_s = 1;
  226|  1.66M|      sign_t = 1;
  227|  1.66M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 239k, False: 105k]
  |  Branch (227:27): [True: 137k, False: 101k]
  ------------------
  228|   137k|      sign_s = -1;
  229|   137k|      sign_t = -1;
  230|   206k|    } else {
  231|   206k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 105k, False: 101k]
  ------------------
  232|   206k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 101k, False: 105k]
  ------------------
  233|   206k|    }
  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|  2.01M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  2.01M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  2.01M|    uint32_t us = *s;
  241|  2.01M|    uint32_t ut = *t;
  242|  2.01M|    us = us + us - corner_point_s;
  243|  2.01M|    ut = ut + ut - corner_point_t;
  244|  2.01M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 1.80M, False: 206k]
  ------------------
  245|  1.80M|      uint32_t temp = us;
  246|  1.80M|      us = -ut;
  247|  1.80M|      ut = -temp;
  248|  1.80M|    } else {
  249|   206k|      std::swap(us, ut);
  250|   206k|    }
  251|  2.01M|    us = us + corner_point_s;
  252|  2.01M|    ut = ut + corner_point_t;
  253|       |
  254|  2.01M|    *s = us;
  255|  2.01M|    *t = ut;
  256|  2.01M|    *s /= 2;
  257|  2.01M|    *t /= 2;
  258|  2.01M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  3.07M|  int32_t ModMax(int32_t x) const {
  273|  3.07M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 4.27k, False: 3.06M]
  ------------------
  274|  4.27k|      return x - this->max_quantized_value();
  275|  4.27k|    }
  276|  3.06M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 1.96k, False: 3.06M]
  ------------------
  277|  1.96k|      return x + this->max_quantized_value();
  278|  1.96k|    }
  279|  3.06M|    return x;
  280|  3.06M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.24k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  6.24k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  9.20M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   126k|                                           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|   126k|    float y = in_s_scaled;
  329|   126k|    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|   126k|    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|   126k|    float x_offset = -x;
  342|   126k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 23.7k, False: 102k]
  ------------------
  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|   126k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 24.6k, False: 101k]
  ------------------
  348|   126k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 24.5k, False: 101k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   126k|    const float norm_squared = x * x + y * y + z * z;
  352|   126k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 126k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   126k|    } else {
  357|   126k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   126k|      out_vector[0] = x * d;
  359|   126k|      out_vector[1] = y * d;
  360|   126k|      out_vector[2] = z * d;
  361|   126k|    }
  362|   126k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.09M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.09M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.09M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.09M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.09M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.09M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.09M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.84M, False: 245k]
  ------------------
  181|  1.84M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.84M|    } else {
  183|   245k|      vec[0] =
  184|   245k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   245k|          abs_sum;
  186|   245k|      vec[1] =
  187|   245k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   245k|          abs_sum;
  189|   245k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 132k, False: 113k]
  ------------------
  190|   132k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   132k|      } else {
  192|   113k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   113k|      }
  194|   245k|    }
  195|  2.09M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    342|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    342|            attribute, transform, mesh_data),
   52|    342|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    322|                                                                *buffer) {
  194|    322|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    322|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    322|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 5, False: 317]
  ------------------
  196|       |    // Decode prediction mode.
  197|      5|    uint8_t mode;
  198|      5|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 5]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      5|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 3, False: 2]
  ------------------
  203|       |      // Unsupported mode.
  204|      3|      return false;
  205|      3|    }
  206|      5|  }
  207|    319|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.47k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.20k, False: 270]
  ------------------
  211|  1.20k|    uint32_t num_flags;
  212|  1.20k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 10, False: 1.19k]
  ------------------
  213|     10|      return false;
  214|     10|    }
  215|  1.19k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 25, False: 1.17k]
  ------------------
  216|     25|      return false;
  217|     25|    }
  218|  1.17k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 462, False: 710]
  ------------------
  219|    462|      is_crease_edge_[i].resize(num_flags);
  220|    462|      RAnsBitDecoder decoder;
  221|    462|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 14, False: 448]
  ------------------
  222|     14|        return false;
  223|     14|      }
  224|  2.56M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 2.56M, False: 448]
  ------------------
  225|  2.56M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  2.56M|      }
  227|    448|      decoder.EndDecoding();
  228|    448|    }
  229|  1.17k|  }
  230|    270|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    270|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    319|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    241|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    241|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    241|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.20k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 964, False: 241]
  ------------------
   93|    964|    pred_vals[i].resize(num_components, 0);
   94|    964|  }
   95|    241|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    241|                                         out_data);
   97|       |
   98|    241|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    241|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    241|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    241|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    241|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    241|  const int corner_map_size =
  109|    241|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  1.08M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 1.08M, False: 146]
  ------------------
  111|  1.08M|    const CornerIndex start_corner_id =
  112|  1.08M|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  1.08M|    CornerIndex corner_id(start_corner_id);
  115|  1.08M|    int num_parallelograms = 0;
  116|  1.08M|    bool first_pass = true;
  117|  2.38M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.34M, False: 1.04M]
  ------------------
  118|  1.34M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 101k, False: 1.24M]
  ------------------
  119|  1.34M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.34M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   101k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   101k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 931, False: 100k]
  ------------------
  127|    931|          break;
  128|    931|        }
  129|   101k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|  1.34M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.33M, False: 11.2k]
  ------------------
  134|  1.33M|        corner_id = table->SwingLeft(corner_id);
  135|  1.33M|      } else {
  136|  11.2k|        corner_id = table->SwingRight(corner_id);
  137|  11.2k|      }
  138|  1.34M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 47.1k, False: 1.29M]
  ------------------
  139|  47.1k|        break;
  140|  47.1k|      }
  141|  1.29M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.04M, False: 253k]
  |  Branch (141:47): [True: 1.04M, False: 4.94k]
  ------------------
  142|  1.04M|        first_pass = false;
  143|  1.04M|        corner_id = table->SwingRight(start_corner_id);
  144|  1.04M|      }
  145|  1.29M|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  1.08M|    int num_used_parallelograms = 0;
  150|  1.08M|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 55.4k, False: 1.03M]
  ------------------
  151|  7.99M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 7.93M, False: 55.4k]
  ------------------
  152|  7.93M|        multi_pred_vals[i] = 0;
  153|  7.93M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   156k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 101k, False: 55.3k]
  ------------------
  156|   101k|        const int context = num_parallelograms - 1;
  157|   101k|        const int pos = is_crease_edge_pos[context]++;
  158|   101k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 95, False: 100k]
  ------------------
  159|     95|          return false;
  160|     95|        }
  161|   100k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   100k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 28.0k, False: 72.9k]
  ------------------
  163|  28.0k|          ++num_used_parallelograms;
  164|  4.00M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 3.97M, False: 28.0k]
  ------------------
  165|  3.97M|            multi_pred_vals[j] =
  166|  3.97M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  3.97M|          }
  168|  28.0k|        }
  169|   100k|      }
  170|  55.4k|    }
  171|  1.08M|    const int dst_offset = p * num_components;
  172|  1.08M|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 1.07M, False: 11.1k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  1.07M|      const int src_offset = (p - 1) * num_components;
  176|  1.07M|      this->transform().ComputeOriginalValue(
  177|  1.07M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  1.07M|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  1.53M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 1.52M, False: 11.1k]
  ------------------
  181|  1.52M|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  1.52M|      }
  183|  11.1k|      this->transform().ComputeOriginalValue(
  184|  11.1k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  11.1k|    }
  186|  1.08M|  }
  187|    146|  return true;
  188|    241|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    361|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    361|            attribute, transform, mesh_data),
   52|    361|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    333|                                                                *buffer) {
  194|    333|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    333|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    333|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 3, False: 330]
  ------------------
  196|       |    // Decode prediction mode.
  197|      3|    uint8_t mode;
  198|      3|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 3]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      3|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 2, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      2|      return false;
  205|      2|    }
  206|      3|  }
  207|    331|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.43k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.18k, False: 252]
  ------------------
  211|  1.18k|    uint32_t num_flags;
  212|  1.18k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 11, False: 1.17k]
  ------------------
  213|     11|      return false;
  214|     11|    }
  215|  1.17k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 40, False: 1.13k]
  ------------------
  216|     40|      return false;
  217|     40|    }
  218|  1.13k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 515, False: 618]
  ------------------
  219|    515|      is_crease_edge_[i].resize(num_flags);
  220|    515|      RAnsBitDecoder decoder;
  221|    515|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 28, False: 487]
  ------------------
  222|     28|        return false;
  223|     28|      }
  224|  1.47M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.47M, False: 487]
  ------------------
  225|  1.47M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.47M|      }
  227|    487|      decoder.EndDecoding();
  228|    487|    }
  229|  1.13k|  }
  230|    252|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    252|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    331|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    213|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    213|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    213|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.06k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 852, False: 213]
  ------------------
   93|    852|    pred_vals[i].resize(num_components, 0);
   94|    852|  }
   95|    213|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    213|                                         out_data);
   97|       |
   98|    213|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    213|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    213|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    213|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    213|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    213|  const int corner_map_size =
  109|    213|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   100k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 100k, False: 88]
  ------------------
  111|   100k|    const CornerIndex start_corner_id =
  112|   100k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   100k|    CornerIndex corner_id(start_corner_id);
  115|   100k|    int num_parallelograms = 0;
  116|   100k|    bool first_pass = true;
  117|   582k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 576k, False: 6.05k]
  ------------------
  118|   576k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 186k, False: 390k]
  ------------------
  119|   576k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   576k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   186k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   186k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 353, False: 185k]
  ------------------
  127|    353|          break;
  128|    353|        }
  129|   186k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|   576k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 569k, False: 7.15k]
  ------------------
  134|   569k|        corner_id = table->SwingLeft(corner_id);
  135|   569k|      } else {
  136|  7.15k|        corner_id = table->SwingRight(corner_id);
  137|  7.15k|      }
  138|   576k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 93.6k, False: 482k]
  ------------------
  139|  93.6k|        break;
  140|  93.6k|      }
  141|   482k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 9.61k, False: 473k]
  |  Branch (141:47): [True: 6.06k, False: 3.55k]
  ------------------
  142|  6.06k|        first_pass = false;
  143|  6.06k|        corner_id = table->SwingRight(start_corner_id);
  144|  6.06k|      }
  145|   482k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   100k|    int num_used_parallelograms = 0;
  150|   100k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 97.2k, False: 2.80k]
  ------------------
  151|  7.32M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 7.22M, False: 97.2k]
  ------------------
  152|  7.22M|        multi_pred_vals[i] = 0;
  153|  7.22M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   283k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 185k, False: 97.1k]
  ------------------
  156|   185k|        const int context = num_parallelograms - 1;
  157|   185k|        const int pos = is_crease_edge_pos[context]++;
  158|   185k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 125, False: 185k]
  ------------------
  159|    125|          return false;
  160|    125|        }
  161|   185k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   185k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 18.9k, False: 166k]
  ------------------
  163|  18.9k|          ++num_used_parallelograms;
  164|  1.11M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.09M, False: 18.9k]
  ------------------
  165|  1.09M|            multi_pred_vals[j] =
  166|  1.09M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.09M|          }
  168|  18.9k|        }
  169|   185k|      }
  170|  97.2k|    }
  171|  99.9k|    const int dst_offset = p * num_components;
  172|  99.9k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 90.5k, False: 9.43k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  90.5k|      const int src_offset = (p - 1) * num_components;
  176|  90.5k|      this->transform().ComputeOriginalValue(
  177|  90.5k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  90.5k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   539k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 530k, False: 9.43k]
  ------------------
  181|   530k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   530k|      }
  183|  9.43k|      this->transform().ComputeOriginalValue(
  184|  9.43k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  9.43k|    }
  186|  99.9k|  }
  187|     88|  return true;
  188|    213|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.90k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.90k|    mesh_ = mesh;
   39|  1.90k|    corner_table_ = table;
   40|  1.90k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.90k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.90k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  11.8M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  8.01M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  8.01M|    return vertex_to_data_map_;
   48|  8.01M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  6.18M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  6.18M|    return data_to_corner_map_;
   51|  6.18M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.15k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.15k|    mesh_ = mesh;
   39|  2.15k|    corner_table_ = table;
   40|  2.15k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.15k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.15k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  8.97M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  7.62M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  7.62M|    return vertex_to_data_map_;
   48|  7.62M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.12M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.12M|    return data_to_corner_map_;
   51|  2.12M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  1.90k|      : mesh_(nullptr),
   31|  1.90k|        corner_table_(nullptr),
   32|  1.90k|        vertex_to_data_map_(nullptr),
   33|  1.90k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  2.15k|      : mesh_(nullptr),
   31|  2.15k|        corner_table_(nullptr),
   32|  2.15k|        vertex_to_data_map_(nullptr),
   33|  2.15k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   530k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   188k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   369k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   181k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.60k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.60k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  9.71M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.90k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.90k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  3.06M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    143|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    143|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    113|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    113|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    134|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    134|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    133|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    133|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    285|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    143|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    143|    DRACO_DCHECK_EQ(i, 0);
   70|    143|    (void)i;
   71|    143|    return GeometryAttribute::POSITION;
   72|    143|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    143|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    143|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 143]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    143|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 142]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    142|    predictor_.SetPositionAttribute(*att);
   82|    142|    return true;
   83|    143|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    142|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    142|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 9, False: 133]
  ------------------
  145|      9|    return false;
  146|      9|  }
  147|       |
  148|    133|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    133|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    133|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 31, False: 102]
  ------------------
  150|     31|    uint8_t prediction_mode;
  151|     31|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 31]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     31|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 30]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     30|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 30]
  ------------------
  160|     30|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     30|  }
  164|    132|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    132|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 7, False: 125]
  ------------------
  168|      7|    return false;
  169|      7|  }
  170|       |
  171|    125|  return true;
  172|    132|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    125|                                      const PointIndex *entry_to_point_id_map) {
  103|    125|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    125|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    125|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    125|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    125|  const int corner_map_size =
  111|    125|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    125|  VectorD<int32_t, 3> pred_normal_3d;
  114|    125|  int32_t pred_normal_oct[2];
  115|       |
  116|   530k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 530k, False: 125]
  ------------------
  117|   530k|    const CornerIndex corner_id =
  118|   530k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   530k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   530k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   530k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   530k|                    octahedron_tool_box_.center_value());
  125|   530k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 163k, False: 367k]
  ------------------
  126|   163k|      pred_normal_3d = -pred_normal_3d;
  127|   163k|    }
  128|   530k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   530k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   530k|    const int data_offset = data_id * 2;
  132|   530k|    this->transform().ComputeOriginalValue(
  133|   530k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   530k|  }
  135|    125|  flip_normal_bit_decoder_.EndDecoding();
  136|    125|  return true;
  137|    125|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    125|  void SetQuantizationBits(int q) {
   85|    125|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    125|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    225|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    113|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    113|    DRACO_DCHECK_EQ(i, 0);
   70|    113|    (void)i;
   71|    113|    return GeometryAttribute::POSITION;
   72|    113|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    113|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    113|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 113]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    113|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 112]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    112|    predictor_.SetPositionAttribute(*att);
   82|    112|    return true;
   83|    113|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    112|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    112|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 107]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    107|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    107|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    107|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 9, False: 98]
  ------------------
  150|      9|    uint8_t prediction_mode;
  151|      9|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 9]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|      9|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 0, False: 9]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      0|      return false;
  157|      0|    }
  158|       |
  159|      9|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 9]
  ------------------
  160|      9|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|      9|  }
  164|    107|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    107|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 2, False: 105]
  ------------------
  168|      2|    return false;
  169|      2|  }
  170|       |
  171|    105|  return true;
  172|    107|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    105|                                      const PointIndex *entry_to_point_id_map) {
  103|    105|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    105|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    105|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    105|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    105|  const int corner_map_size =
  111|    105|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    105|  VectorD<int32_t, 3> pred_normal_3d;
  114|    105|  int32_t pred_normal_oct[2];
  115|       |
  116|   188k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 188k, False: 105]
  ------------------
  117|   188k|    const CornerIndex corner_id =
  118|   188k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   188k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   188k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   188k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   188k|                    octahedron_tool_box_.center_value());
  125|   188k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 180k, False: 7.71k]
  ------------------
  126|   180k|      pred_normal_3d = -pred_normal_3d;
  127|   180k|    }
  128|   188k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   188k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   188k|    const int data_offset = data_id * 2;
  132|   188k|    this->transform().ComputeOriginalValue(
  133|   188k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   188k|  }
  135|    105|  flip_normal_bit_decoder_.EndDecoding();
  136|    105|  return true;
  137|    105|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    105|  void SetQuantizationBits(int q) {
   85|    105|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    105|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    266|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    134|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    134|    DRACO_DCHECK_EQ(i, 0);
   70|    134|    (void)i;
   71|    134|    return GeometryAttribute::POSITION;
   72|    134|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    133|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    133|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 133]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    133|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 132]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    132|    predictor_.SetPositionAttribute(*att);
   82|    132|    return true;
   83|    133|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    131|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    131|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 126]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    126|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    126|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    126|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 40, False: 86]
  ------------------
  150|     40|    uint8_t prediction_mode;
  151|     40|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 40]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     40|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 10, False: 30]
  ------------------
  155|       |      // Invalid prediction mode.
  156|     10|      return false;
  157|     10|    }
  158|       |
  159|     30|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 30]
  ------------------
  160|     30|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     30|  }
  164|    116|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    116|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 111]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    111|  return true;
  172|    116|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    111|                                      const PointIndex *entry_to_point_id_map) {
  103|    111|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    111|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    111|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    111|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    111|  const int corner_map_size =
  111|    111|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    111|  VectorD<int32_t, 3> pred_normal_3d;
  114|    111|  int32_t pred_normal_oct[2];
  115|       |
  116|   369k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 369k, False: 111]
  ------------------
  117|   369k|    const CornerIndex corner_id =
  118|   369k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   369k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   369k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   369k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   369k|                    octahedron_tool_box_.center_value());
  125|   369k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 336k, False: 33.4k]
  ------------------
  126|   336k|      pred_normal_3d = -pred_normal_3d;
  127|   336k|    }
  128|   369k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   369k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   369k|    const int data_offset = data_id * 2;
  132|   369k|    this->transform().ComputeOriginalValue(
  133|   369k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   369k|  }
  135|    111|  flip_normal_bit_decoder_.EndDecoding();
  136|    111|  return true;
  137|    111|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    111|  void SetQuantizationBits(int q) {
   85|    111|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    111|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    264|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    133|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    133|    DRACO_DCHECK_EQ(i, 0);
   70|    133|    (void)i;
   71|    133|    return GeometryAttribute::POSITION;
   72|    133|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    133|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    133|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 133]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    133|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 131]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    131|    predictor_.SetPositionAttribute(*att);
   82|    131|    return true;
   83|    133|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    131|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    131|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 7, False: 124]
  ------------------
  145|      7|    return false;
  146|      7|  }
  147|       |
  148|    124|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    124|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    124|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 20, False: 104]
  ------------------
  150|     20|    uint8_t prediction_mode;
  151|     20|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 20]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     20|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 18]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     18|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 18]
  ------------------
  160|     18|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     18|  }
  164|    122|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    122|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 6, False: 116]
  ------------------
  168|      6|    return false;
  169|      6|  }
  170|       |
  171|    116|  return true;
  172|    122|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    116|                                      const PointIndex *entry_to_point_id_map) {
  103|    116|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    116|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    116|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    116|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    116|  const int corner_map_size =
  111|    116|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    116|  VectorD<int32_t, 3> pred_normal_3d;
  114|    116|  int32_t pred_normal_oct[2];
  115|       |
  116|   181k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 181k, False: 116]
  ------------------
  117|   181k|    const CornerIndex corner_id =
  118|   181k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   181k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   181k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   181k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   181k|                    octahedron_tool_box_.center_value());
  125|   181k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 180k, False: 925]
  ------------------
  126|   180k|      pred_normal_3d = -pred_normal_3d;
  127|   180k|    }
  128|   181k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   181k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   181k|    const int data_offset = data_id * 2;
  132|   181k|    this->transform().ComputeOriginalValue(
  133|   181k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   181k|  }
  135|    116|  flip_normal_bit_decoder_.EndDecoding();
  136|    116|  return true;
  137|    116|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    116|  void SetQuantizationBits(int q) {
   85|    116|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    116|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    215|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    215|            attribute, transform, mesh_data),
   37|    215|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    426|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    215|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    215|    DRACO_DCHECK_EQ(i, 0);
   70|    215|    (void)i;
   71|    215|    return GeometryAttribute::POSITION;
   72|    215|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    213|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    213|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 213]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    213|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 211]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    211|    predictor_.SetPositionAttribute(*att);
   82|    211|    return true;
   83|    213|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    210|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    210|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 14, False: 196]
  ------------------
  145|     14|    return false;
  146|     14|  }
  147|       |
  148|    196|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    196|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    196|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 63, False: 133]
  ------------------
  150|     63|    uint8_t prediction_mode;
  151|     63|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 63]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     63|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 4, False: 59]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      4|      return false;
  157|      4|    }
  158|       |
  159|     59|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 59]
  ------------------
  160|     59|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     59|  }
  164|    192|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    192|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 8, False: 184]
  ------------------
  168|      8|    return false;
  169|      8|  }
  170|       |
  171|    184|  return true;
  172|    192|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    184|                                      const PointIndex *entry_to_point_id_map) {
  103|    184|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    184|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    184|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    184|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    184|  const int corner_map_size =
  111|    184|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    184|  VectorD<int32_t, 3> pred_normal_3d;
  114|    184|  int32_t pred_normal_oct[2];
  115|       |
  116|   658k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 658k, False: 184]
  ------------------
  117|   658k|    const CornerIndex corner_id =
  118|   658k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   658k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   658k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   658k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   658k|                    octahedron_tool_box_.center_value());
  125|   658k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 655k, False: 3.11k]
  ------------------
  126|   655k|      pred_normal_3d = -pred_normal_3d;
  127|   655k|    }
  128|   658k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   658k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   658k|    const int data_offset = data_id * 2;
  132|   658k|    this->transform().ComputeOriginalValue(
  133|   658k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   658k|  }
  135|    184|  flip_normal_bit_decoder_.EndDecoding();
  136|    184|  return true;
  137|    184|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    184|  void SetQuantizationBits(int q) {
   85|    184|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    184|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    403|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    403|            attribute, transform, mesh_data),
   37|    403|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    805|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    403|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    403|    DRACO_DCHECK_EQ(i, 0);
   70|    403|    (void)i;
   71|    403|    return GeometryAttribute::POSITION;
   72|    403|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    403|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    403|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 403]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    403|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 402]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    402|    predictor_.SetPositionAttribute(*att);
   82|    402|    return true;
   83|    403|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    399|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    399|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 19, False: 380]
  ------------------
  145|     19|    return false;
  146|     19|  }
  147|       |
  148|    380|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    380|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    380|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 99, False: 281]
  ------------------
  150|     99|    uint8_t prediction_mode;
  151|     99|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 11, False: 88]
  ------------------
  152|     11|      return false;
  153|     11|    }
  154|     88|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 87]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     87|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 87]
  ------------------
  160|     87|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     87|  }
  164|    368|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    368|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 21, False: 347]
  ------------------
  168|     21|    return false;
  169|     21|  }
  170|       |
  171|    347|  return true;
  172|    368|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    347|                                      const PointIndex *entry_to_point_id_map) {
  103|    347|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    347|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    347|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    347|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    347|  const int corner_map_size =
  111|    347|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    347|  VectorD<int32_t, 3> pred_normal_3d;
  114|    347|  int32_t pred_normal_oct[2];
  115|       |
  116|   166k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 166k, False: 347]
  ------------------
  117|   166k|    const CornerIndex corner_id =
  118|   166k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   166k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   166k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   166k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   166k|                    octahedron_tool_box_.center_value());
  125|   166k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 157k, False: 9.21k]
  ------------------
  126|   157k|      pred_normal_3d = -pred_normal_3d;
  127|   157k|    }
  128|   166k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   166k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   166k|    const int data_offset = data_id * 2;
  132|   166k|    this->transform().ComputeOriginalValue(
  133|   166k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   166k|  }
  135|    347|  flip_normal_bit_decoder_.EndDecoding();
  136|    347|  return true;
  137|    347|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    347|  void SetQuantizationBits(int q) {
   85|    347|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    347|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    143|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    143|            attribute, transform, mesh_data),
   37|    143|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    113|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    113|            attribute, transform, mesh_data),
   37|    113|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    134|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    134|            attribute, transform, mesh_data),
   37|    134|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    133|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    133|            attribute, transform, mesh_data),
   37|    133|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    173|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    173|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 29, False: 144]
  ------------------
  105|     29|      this->normal_prediction_mode_ = mode;
  106|     29|      return true;
  107|    144|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 144, False: 0]
  ------------------
  108|    144|      this->normal_prediction_mode_ = mode;
  109|    144|      return true;
  110|    144|    }
  111|      0|    return false;
  112|    173|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   530k|                             DataTypeT *prediction) override {
   42|   530k|    DRACO_DCHECK(this->IsInitialized());
   43|   530k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   530k|    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|   530k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   530k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   530k|    VectorD<int64_t, 3> normal;
   53|   530k|    CornerIndex c_next, c_prev;
   54|  1.20M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 673k, False: 530k]
  ------------------
   55|       |      // Getting corners.
   56|   673k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 156, False: 673k]
  ------------------
   57|    156|        c_next = corner_table->Next(corner_id);
   58|    156|        c_prev = corner_table->Previous(corner_id);
   59|   673k|      } else {
   60|   673k|        c_next = corner_table->Next(cit.Corner());
   61|   673k|        c_prev = corner_table->Previous(cit.Corner());
   62|   673k|      }
   63|   673k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   673k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   673k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   673k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   673k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   673k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   673k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   673k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   673k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   673k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   673k|      cit.Next();
   81|   673k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   530k|    constexpr int64_t upper_bound = 1 << 29;
   85|   530k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 104, False: 530k]
  ------------------
   86|    104|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    104|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 51, False: 53]
  ------------------
   88|     51|        const int64_t quotient = abs_sum / upper_bound;
   89|     51|        normal = normal / quotient;
   90|     51|      }
   91|   530k|    } else {
   92|   530k|      const int64_t abs_sum = normal.AbsSum();
   93|   530k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.89k, False: 528k]
  ------------------
   94|  1.89k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.89k|        normal = normal / quotient;
   96|  1.89k|      }
   97|   530k|    }
   98|   530k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   530k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   530k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   530k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   530k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    122|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    122|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 8, False: 114]
  ------------------
  105|      8|      this->normal_prediction_mode_ = mode;
  106|      8|      return true;
  107|    114|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 114, False: 0]
  ------------------
  108|    114|      this->normal_prediction_mode_ = mode;
  109|    114|      return true;
  110|    114|    }
  111|      0|    return false;
  112|    122|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   188k|                             DataTypeT *prediction) override {
   42|   188k|    DRACO_DCHECK(this->IsInitialized());
   43|   188k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   188k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   188k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   188k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   188k|    VectorD<int64_t, 3> normal;
   53|   188k|    CornerIndex c_next, c_prev;
   54|  1.31M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.12M, False: 188k]
  ------------------
   55|       |      // Getting corners.
   56|  1.12M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 42, False: 1.12M]
  ------------------
   57|     42|        c_next = corner_table->Next(corner_id);
   58|     42|        c_prev = corner_table->Previous(corner_id);
   59|  1.12M|      } else {
   60|  1.12M|        c_next = corner_table->Next(cit.Corner());
   61|  1.12M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.12M|      }
   63|  1.12M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.12M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.12M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.12M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.12M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.12M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.12M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.12M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.12M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.12M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.12M|      cit.Next();
   81|  1.12M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   188k|    constexpr int64_t upper_bound = 1 << 29;
   85|   188k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 28, False: 188k]
  ------------------
   86|     28|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     28|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 11, False: 17]
  ------------------
   88|     11|        const int64_t quotient = abs_sum / upper_bound;
   89|     11|        normal = normal / quotient;
   90|     11|      }
   91|   188k|    } else {
   92|   188k|      const int64_t abs_sum = normal.AbsSum();
   93|   188k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 118k, False: 70.1k]
  ------------------
   94|   118k|        const int64_t quotient = abs_sum / upper_bound;
   95|   118k|        normal = normal / quotient;
   96|   118k|      }
   97|   188k|    }
   98|   188k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   188k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   188k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   188k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   188k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    164|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    164|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 28, False: 136]
  ------------------
  105|     28|      this->normal_prediction_mode_ = mode;
  106|     28|      return true;
  107|    136|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 136, False: 0]
  ------------------
  108|    136|      this->normal_prediction_mode_ = mode;
  109|    136|      return true;
  110|    136|    }
  111|      0|    return false;
  112|    164|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   369k|                             DataTypeT *prediction) override {
   42|   369k|    DRACO_DCHECK(this->IsInitialized());
   43|   369k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   369k|    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|   369k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   369k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   369k|    VectorD<int64_t, 3> normal;
   53|   369k|    CornerIndex c_next, c_prev;
   54|  1.12M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 751k, False: 369k]
  ------------------
   55|       |      // Getting corners.
   56|   751k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 150, False: 751k]
  ------------------
   57|    150|        c_next = corner_table->Next(corner_id);
   58|    150|        c_prev = corner_table->Previous(corner_id);
   59|   751k|      } else {
   60|   751k|        c_next = corner_table->Next(cit.Corner());
   61|   751k|        c_prev = corner_table->Previous(cit.Corner());
   62|   751k|      }
   63|   751k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   751k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   751k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   751k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   751k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   751k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   751k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   751k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   751k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   751k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   751k|      cit.Next();
   81|   751k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   369k|    constexpr int64_t upper_bound = 1 << 29;
   85|   369k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 100, False: 369k]
  ------------------
   86|    100|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    100|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 42, False: 58]
  ------------------
   88|     42|        const int64_t quotient = abs_sum / upper_bound;
   89|     42|        normal = normal / quotient;
   90|     42|      }
   91|   369k|    } else {
   92|   369k|      const int64_t abs_sum = normal.AbsSum();
   93|   369k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.69k, False: 367k]
  ------------------
   94|  1.69k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.69k|        normal = normal / quotient;
   96|  1.69k|      }
   97|   369k|    }
   98|   369k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   369k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   369k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   369k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   369k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    151|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    151|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 16, False: 135]
  ------------------
  105|     16|      this->normal_prediction_mode_ = mode;
  106|     16|      return true;
  107|    135|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 135, False: 0]
  ------------------
  108|    135|      this->normal_prediction_mode_ = mode;
  109|    135|      return true;
  110|    135|    }
  111|      0|    return false;
  112|    151|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   181k|                             DataTypeT *prediction) override {
   42|   181k|    DRACO_DCHECK(this->IsInitialized());
   43|   181k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   181k|    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|   181k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   181k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   181k|    VectorD<int64_t, 3> normal;
   53|   181k|    CornerIndex c_next, c_prev;
   54|  1.26M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.08M, False: 181k]
  ------------------
   55|       |      // Getting corners.
   56|  1.08M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 90, False: 1.08M]
  ------------------
   57|     90|        c_next = corner_table->Next(corner_id);
   58|     90|        c_prev = corner_table->Previous(corner_id);
   59|  1.08M|      } else {
   60|  1.08M|        c_next = corner_table->Next(cit.Corner());
   61|  1.08M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.08M|      }
   63|  1.08M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.08M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.08M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.08M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.08M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.08M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.08M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.08M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.08M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.08M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.08M|      cit.Next();
   81|  1.08M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   181k|    constexpr int64_t upper_bound = 1 << 29;
   85|   181k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 60, False: 181k]
  ------------------
   86|     60|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     60|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 18, False: 42]
  ------------------
   88|     18|        const int64_t quotient = abs_sum / upper_bound;
   89|     18|        normal = normal / quotient;
   90|     18|      }
   91|   181k|    } else {
   92|   181k|      const int64_t abs_sum = normal.AbsSum();
   93|   181k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 106k, False: 75.3k]
  ------------------
   94|   106k|        const int64_t quotient = abs_sum / upper_bound;
   95|   106k|        normal = normal / quotient;
   96|   106k|      }
   97|   181k|    }
   98|   181k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   181k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   181k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   181k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   181k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    215|      : Base(md) {
   35|    215|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    215|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    274|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    274|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 58, False: 216]
  ------------------
  105|     58|      this->normal_prediction_mode_ = mode;
  106|     58|      return true;
  107|    216|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 216, False: 0]
  ------------------
  108|    216|      this->normal_prediction_mode_ = mode;
  109|    216|      return true;
  110|    216|    }
  111|      0|    return false;
  112|    274|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   658k|                             DataTypeT *prediction) override {
   42|   658k|    DRACO_DCHECK(this->IsInitialized());
   43|   658k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   658k|    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|   658k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   658k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   658k|    VectorD<int64_t, 3> normal;
   53|   658k|    CornerIndex c_next, c_prev;
   54|  1.34M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 682k, False: 658k]
  ------------------
   55|       |      // Getting corners.
   56|   682k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 324, False: 681k]
  ------------------
   57|    324|        c_next = corner_table->Next(corner_id);
   58|    324|        c_prev = corner_table->Previous(corner_id);
   59|   681k|      } else {
   60|   681k|        c_next = corner_table->Next(cit.Corner());
   61|   681k|        c_prev = corner_table->Previous(cit.Corner());
   62|   681k|      }
   63|   682k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   682k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   682k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   682k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   682k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   682k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   682k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   682k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   682k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   682k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   682k|      cit.Next();
   81|   682k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   658k|    constexpr int64_t upper_bound = 1 << 29;
   85|   658k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 278, False: 658k]
  ------------------
   86|    278|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    278|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 93, False: 185]
  ------------------
   88|     93|        const int64_t quotient = abs_sum / upper_bound;
   89|     93|        normal = normal / quotient;
   90|     93|      }
   91|   658k|    } else {
   92|   658k|      const int64_t abs_sum = normal.AbsSum();
   93|   658k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.00k, False: 656k]
  ------------------
   94|  2.00k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.00k|        normal = normal / quotient;
   96|  2.00k|      }
   97|   658k|    }
   98|   658k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   658k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   658k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   658k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   658k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    403|      : Base(md) {
   35|    403|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    403|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    490|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    490|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 85, False: 405]
  ------------------
  105|     85|      this->normal_prediction_mode_ = mode;
  106|     85|      return true;
  107|    405|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 405, False: 0]
  ------------------
  108|    405|      this->normal_prediction_mode_ = mode;
  109|    405|      return true;
  110|    405|    }
  111|      0|    return false;
  112|    490|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   166k|                             DataTypeT *prediction) override {
   42|   166k|    DRACO_DCHECK(this->IsInitialized());
   43|   166k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   166k|    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|   166k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   166k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   166k|    VectorD<int64_t, 3> normal;
   53|   166k|    CornerIndex c_next, c_prev;
   54|  1.09M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 931k, False: 166k]
  ------------------
   55|       |      // Getting corners.
   56|   931k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 468, False: 931k]
  ------------------
   57|    468|        c_next = corner_table->Next(corner_id);
   58|    468|        c_prev = corner_table->Previous(corner_id);
   59|   931k|      } else {
   60|   931k|        c_next = corner_table->Next(cit.Corner());
   61|   931k|        c_prev = corner_table->Previous(cit.Corner());
   62|   931k|      }
   63|   931k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   931k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   931k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   931k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   931k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   931k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   931k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   931k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   931k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   931k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   931k|      cit.Next();
   81|   931k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   166k|    constexpr int64_t upper_bound = 1 << 29;
   85|   166k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 450, False: 165k]
  ------------------
   86|    450|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    450|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 173, False: 277]
  ------------------
   88|    173|        const int64_t quotient = abs_sum / upper_bound;
   89|    173|        normal = normal / quotient;
   90|    173|      }
   91|   165k|    } else {
   92|   165k|      const int64_t abs_sum = normal.AbsSum();
   93|   165k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.68k, False: 163k]
  ------------------
   94|  2.68k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.68k|        normal = normal / quotient;
   96|  2.68k|      }
   97|   165k|    }
   98|   166k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   166k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   166k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   166k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   166k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    143|      : Base(md) {
   35|    143|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    143|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    113|      : Base(md) {
   35|    113|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    113|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    134|      : Base(md) {
   35|    134|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    134|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    133|      : Base(md) {
   35|    133|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    133|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.87M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.87M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.87M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.87M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.87M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.87M|    return GetPositionForDataId(data_id);
   77|  1.87M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.87M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.87M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.87M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.87M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.87M|    VectorD<int64_t, 3> pos;
   68|  1.87M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.87M|    return pos;
   70|  1.87M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    142|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    142|    pos_attribute_ = &position_attribute;
   43|    142|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    125|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    125|    entry_to_point_id_map_ = map;
   46|    125|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.43M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.43M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.43M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.43M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.43M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.43M|    return GetPositionForDataId(data_id);
   77|  2.43M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.43M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.43M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.43M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.43M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.43M|    VectorD<int64_t, 3> pos;
   68|  2.43M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.43M|    return pos;
   70|  2.43M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    112|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    112|    pos_attribute_ = &position_attribute;
   43|    112|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    105|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    105|    entry_to_point_id_map_ = map;
   46|    105|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.87M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.87M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.87M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.87M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.87M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.87M|    return GetPositionForDataId(data_id);
   77|  1.87M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.87M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.87M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.87M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.87M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.87M|    VectorD<int64_t, 3> pos;
   68|  1.87M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.87M|    return pos;
   70|  1.87M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    132|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    132|    pos_attribute_ = &position_attribute;
   43|    132|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    111|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    111|    entry_to_point_id_map_ = map;
   46|    111|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.34M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.34M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.34M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.34M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.34M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.34M|    return GetPositionForDataId(data_id);
   77|  2.34M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.34M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.34M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.34M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.34M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.34M|    VectorD<int64_t, 3> pos;
   68|  2.34M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.34M|    return pos;
   70|  2.34M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    131|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    131|    pos_attribute_ = &position_attribute;
   43|    131|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    116|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    116|    entry_to_point_id_map_ = map;
   46|    116|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    215|      : pos_attribute_(nullptr),
   36|    215|        entry_to_point_id_map_(nullptr),
   37|    215|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    215|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.02M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.02M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.02M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.02M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.02M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.02M|    return GetPositionForDataId(data_id);
   77|  2.02M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.02M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.02M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.02M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.02M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.02M|    VectorD<int64_t, 3> pos;
   68|  2.02M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.02M|    return pos;
   70|  2.02M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    211|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    211|    pos_attribute_ = &position_attribute;
   43|    211|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    184|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    184|    entry_to_point_id_map_ = map;
   46|    184|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    403|      : pos_attribute_(nullptr),
   36|    403|        entry_to_point_id_map_(nullptr),
   37|    403|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    403|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.03M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.03M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.03M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.03M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.03M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.03M|    return GetPositionForDataId(data_id);
   77|  2.03M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.03M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.03M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.03M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.03M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.03M|    VectorD<int64_t, 3> pos;
   68|  2.03M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.03M|    return pos;
   70|  2.03M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    402|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    402|    pos_attribute_ = &position_attribute;
   43|    402|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    347|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    347|    entry_to_point_id_map_ = map;
   46|    347|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    143|      : pos_attribute_(nullptr),
   36|    143|        entry_to_point_id_map_(nullptr),
   37|    143|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    143|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    113|      : pos_attribute_(nullptr),
   36|    113|        entry_to_point_id_map_(nullptr),
   37|    113|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    113|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    134|      : pos_attribute_(nullptr),
   36|    134|        entry_to_point_id_map_(nullptr),
   37|    134|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    134|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    133|      : pos_attribute_(nullptr),
   36|    133|        entry_to_point_id_map_(nullptr),
   37|    133|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    133|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    275|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    275|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    262|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    262|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    262|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    262|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    262|      new DataTypeT[num_components]());
   70|       |
   71|    262|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    262|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    262|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    262|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    262|  const int corner_map_size =
   78|    262|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  1.33M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 1.33M, False: 262]
  ------------------
   80|  1.33M|    const CornerIndex start_corner_id =
   81|  1.33M|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  1.33M|    CornerIndex corner_id(start_corner_id);
   84|  1.33M|    int num_parallelograms = 0;
   85|   102M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 101M, False: 1.33M]
  ------------------
   86|   101M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|   101M|    }
   88|  3.02M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.69M, False: 1.33M]
  ------------------
   89|  1.69M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 147k, False: 1.54M]
  ------------------
   90|  1.69M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.69M|              num_components, parallelogram_pred_vals.get())) {
   92|  10.4M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 10.3M, False: 147k]
  ------------------
   93|  10.3M|          pred_vals[c] =
   94|  10.3M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  10.3M|        }
   96|   147k|        ++num_parallelograms;
   97|   147k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.69M|      corner_id = table->SwingRight(corner_id);
  101|  1.69M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 69.1k, False: 1.62M]
  ------------------
  102|  69.1k|        corner_id = kInvalidCornerIndex;
  103|  69.1k|      }
  104|  1.69M|    }
  105|       |
  106|  1.33M|    const int dst_offset = p * num_components;
  107|  1.33M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.25M, False: 79.6k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.25M|      const int src_offset = (p - 1) * num_components;
  111|  1.25M|      this->transform().ComputeOriginalValue(
  112|  1.25M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  1.25M|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  5.61M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 5.53M, False: 79.6k]
  ------------------
  116|  5.53M|        pred_vals[c] /= num_parallelograms;
  117|  5.53M|      }
  118|  79.6k|      this->transform().ComputeOriginalValue(
  119|  79.6k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  79.6k|    }
  121|  1.33M|  }
  122|    262|  return true;
  123|    262|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    362|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    362|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    337|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    337|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    337|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    337|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    337|      new DataTypeT[num_components]());
   70|       |
   71|    337|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    337|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    337|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    337|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    337|  const int corner_map_size =
   78|    337|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   634k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 634k, False: 337]
  ------------------
   80|   634k|    const CornerIndex start_corner_id =
   81|   634k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   634k|    CornerIndex corner_id(start_corner_id);
   84|   634k|    int num_parallelograms = 0;
   85|  19.5M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 18.8M, False: 634k]
  ------------------
   86|  18.8M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  18.8M|    }
   88|  4.39M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 3.76M, False: 634k]
  ------------------
   89|  3.76M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.23M, False: 2.52M]
  ------------------
   90|  3.76M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  3.76M|              num_components, parallelogram_pred_vals.get())) {
   92|  38.1M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 36.9M, False: 1.23M]
  ------------------
   93|  36.9M|          pred_vals[c] =
   94|  36.9M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  36.9M|        }
   96|  1.23M|        ++num_parallelograms;
   97|  1.23M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  3.76M|      corner_id = table->SwingRight(corner_id);
  101|  3.76M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 623k, False: 3.13M]
  ------------------
  102|   623k|        corner_id = kInvalidCornerIndex;
  103|   623k|      }
  104|  3.76M|    }
  105|       |
  106|   634k|    const int dst_offset = p * num_components;
  107|   634k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.10k, False: 632k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.10k|      const int src_offset = (p - 1) * num_components;
  111|  1.10k|      this->transform().ComputeOriginalValue(
  112|  1.10k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   632k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  19.4M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 18.8M, False: 632k]
  ------------------
  116|  18.8M|        pred_vals[c] /= num_parallelograms;
  117|  18.8M|      }
  118|   632k|      this->transform().ComputeOriginalValue(
  119|   632k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   632k|    }
  121|   634k|  }
  122|    337|  return true;
  123|    337|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  4.12M|    int num_components, DataTypeT *out_prediction) {
   49|  4.12M|  const CornerIndex oci = table->Opposite(ci);
   50|  4.12M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 3.34M, False: 778k]
  ------------------
   51|  3.34M|    return false;
   52|  3.34M|  }
   53|   778k|  int vert_opp, vert_next, vert_prev;
   54|   778k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   778k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   778k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 405k, False: 373k]
  |  Branch (56:35): [True: 307k, False: 98.0k]
  ------------------
   57|   307k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 285k, False: 21.9k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   285k|    const int v_opp_off = vert_opp * num_components;
   60|   285k|    const int v_next_off = vert_next * num_components;
   61|   285k|    const int v_prev_off = vert_prev * num_components;
   62|  28.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 28.4M, False: 285k]
  ------------------
   63|  28.4M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  28.4M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  28.4M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  28.4M|      const int64_t result =
   67|  28.4M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  28.4M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  28.4M|    }
   71|   285k|    return true;
   72|   285k|  }
   73|   493k|  return false;  // Not all data is available for prediction
   74|   778k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   778k|    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|   778k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   778k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   778k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   778k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  4.78M|    int num_components, DataTypeT *out_prediction) {
   49|  4.78M|  const CornerIndex oci = table->Opposite(ci);
   50|  4.78M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 16.7k, False: 4.76M]
  ------------------
   51|  16.7k|    return false;
   52|  16.7k|  }
   53|  4.76M|  int vert_opp, vert_next, vert_prev;
   54|  4.76M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  4.76M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  4.76M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 2.59M, False: 2.17M]
  |  Branch (56:35): [True: 1.99M, False: 591k]
  ------------------
   57|  1.99M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 1.86M, False: 134k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  1.86M|    const int v_opp_off = vert_opp * num_components;
   60|  1.86M|    const int v_next_off = vert_next * num_components;
   61|  1.86M|    const int v_prev_off = vert_prev * num_components;
   62|  76.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 74.5M, False: 1.86M]
  ------------------
   63|  74.5M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  74.5M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  74.5M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  74.5M|      const int64_t result =
   67|  74.5M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  74.5M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  74.5M|    }
   71|  1.86M|    return true;
   72|  1.86M|  }
   73|  2.90M|  return false;  // Not all data is available for prediction
   74|  4.76M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  4.76M|    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|  4.76M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  4.76M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  4.76M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  4.76M|}

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

_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   36|    185|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   37|    185|            attribute, transform, mesh_data),
   38|    185|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   60|    368|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   62|    185|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   63|    185|    DRACO_DCHECK_EQ(i, 0);
   64|    185|    (void)i;
   65|    185|    return GeometryAttribute::POSITION;
   66|    185|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   68|    185|  bool SetParentAttribute(const PointAttribute *att) override {
   69|    185|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (69:9): [True: 0, False: 185]
  |  Branch (69:17): [True: 0, False: 185]
  ------------------
   70|      0|      return false;  // Invalid attribute type.
   71|      0|    }
   72|    185|    if (att->num_components() != 3) {
  ------------------
  |  Branch (72:9): [True: 2, False: 183]
  ------------------
   73|      2|      return false;  // Currently works only for 3 component positions.
   74|      2|    }
   75|    183|    predictor_.SetPositionAttribute(*att);
   76|    183|    return true;
   77|    185|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  118|    181|                                                                *buffer) {
  119|       |  // Decode the delta coded orientations.
  120|    181|  int32_t num_orientations = 0;
  121|    181|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (121:7): [True: 1, False: 180]
  |  Branch (121:45): [True: 7, False: 173]
  ------------------
  122|      8|    return false;
  123|      8|  }
  124|    173|  predictor_.ResizeOrientations(num_orientations);
  125|    173|  bool last_orientation = true;
  126|    173|  RAnsBitDecoder decoder;
  127|    173|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 163]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|  2.75G|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (130:19): [True: 2.75G, False: 163]
  ------------------
  131|  2.75G|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (131:9): [True: 272M, False: 2.48G]
  ------------------
  132|   272M|      last_orientation = !last_orientation;
  133|   272M|    }
  134|  2.75G|    predictor_.set_orientation(i, last_orientation);
  135|  2.75G|  }
  136|    163|  decoder.EndDecoding();
  137|    163|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  138|    163|                                     MeshDataT>::DecodePredictionData(buffer);
  139|    173|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   90|    150|                                      const PointIndex *entry_to_point_id_map) {
   91|    150|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (91:7): [True: 7, False: 143]
  ------------------
   92|    150|                            DataTypeT, MeshDataT>::kNumComponents) {
   93|      7|    return false;
   94|      7|  }
   95|    143|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
   96|    143|  this->transform().Init(num_components);
   97|       |
   98|    143|  const int corner_map_size =
   99|    143|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  100|   384k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (100:19): [True: 384k, False: 92]
  ------------------
  101|   384k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  102|   384k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (102:9): [True: 51, False: 384k]
  ------------------
  103|   384k|                                                          p)) {
  104|     51|      return false;
  105|     51|    }
  106|       |
  107|   384k|    const int dst_offset = p * num_components;
  108|   384k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  109|   384k|                                           in_corr + dst_offset,
  110|   384k|                                           out_data + dst_offset);
  111|   384k|  }
  112|     92|  return true;
  113|    143|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   36|    190|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   37|    190|            attribute, transform, mesh_data),
   38|    190|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   60|    377|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   62|    190|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   63|    190|    DRACO_DCHECK_EQ(i, 0);
   64|    190|    (void)i;
   65|    190|    return GeometryAttribute::POSITION;
   66|    190|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   68|    188|  bool SetParentAttribute(const PointAttribute *att) override {
   69|    188|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (69:9): [True: 0, False: 188]
  |  Branch (69:17): [True: 0, False: 188]
  ------------------
   70|      0|      return false;  // Invalid attribute type.
   71|      0|    }
   72|    188|    if (att->num_components() != 3) {
  ------------------
  |  Branch (72:9): [True: 1, False: 187]
  ------------------
   73|      1|      return false;  // Currently works only for 3 component positions.
   74|      1|    }
   75|    187|    predictor_.SetPositionAttribute(*att);
   76|    187|    return true;
   77|    188|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  118|    178|                                                                *buffer) {
  119|       |  // Decode the delta coded orientations.
  120|    178|  int32_t num_orientations = 0;
  121|    178|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (121:7): [True: 2, False: 176]
  |  Branch (121:45): [True: 1, False: 175]
  ------------------
  122|      3|    return false;
  123|      3|  }
  124|    175|  predictor_.ResizeOrientations(num_orientations);
  125|    175|  bool last_orientation = true;
  126|    175|  RAnsBitDecoder decoder;
  127|    175|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (127:7): [True: 9, False: 166]
  ------------------
  128|      9|    return false;
  129|      9|  }
  130|  2.09G|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (130:19): [True: 2.09G, False: 166]
  ------------------
  131|  2.09G|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (131:9): [True: 234M, False: 1.85G]
  ------------------
  132|   234M|      last_orientation = !last_orientation;
  133|   234M|    }
  134|  2.09G|    predictor_.set_orientation(i, last_orientation);
  135|  2.09G|  }
  136|    166|  decoder.EndDecoding();
  137|    166|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  138|    166|                                     MeshDataT>::DecodePredictionData(buffer);
  139|    175|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   90|    143|                                      const PointIndex *entry_to_point_id_map) {
   91|    143|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (91:7): [True: 9, False: 134]
  ------------------
   92|    143|                            DataTypeT, MeshDataT>::kNumComponents) {
   93|      9|    return false;
   94|      9|  }
   95|    134|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
   96|    134|  this->transform().Init(num_components);
   97|       |
   98|    134|  const int corner_map_size =
   99|    134|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  100|   188k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (100:19): [True: 188k, False: 88]
  ------------------
  101|   188k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  102|   188k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (102:9): [True: 46, False: 188k]
  ------------------
  103|   188k|                                                          p)) {
  104|     46|      return false;
  105|     46|    }
  106|       |
  107|   188k|    const int dst_offset = p * num_components;
  108|   188k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  109|   188k|                                           in_corr + dst_offset,
  110|   188k|                                           out_data + dst_offset);
  111|   188k|  }
  112|     88|  return true;
  113|    134|}

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

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    129|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    374|  bool AreCorrectionsPositive() override {
   71|    374|    return transform_.AreCorrectionsPositive();
   72|    374|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    120|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    120|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 24, False: 96]
  ------------------
   50|     24|      return false;
   51|     24|    }
   52|     96|    return true;
   53|    120|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   744k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    176|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    425|  bool AreCorrectionsPositive() override {
   71|    425|    return transform_.AreCorrectionsPositive();
   72|    425|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    163|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    163|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 19, False: 144]
  ------------------
   50|     19|      return false;
   51|     19|    }
   52|    144|    return true;
   53|    163|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   792k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  3.82k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  2.59k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  3.64k|  bool AreCorrectionsPositive() override {
   71|  3.64k|    return transform_.AreCorrectionsPositive();
   72|  3.64k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  2.84k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  2.84k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 217, False: 2.62k]
  ------------------
   50|    217|      return false;
   51|    217|    }
   52|  2.62k|    return true;
   53|  2.84k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  25.7M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    385|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    443|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    385|                                 const PointCloudDecoder *decoder) {
  188|    385|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    385|      method, att_id, decoder, TransformT());
  190|    385|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    385|                                 const TransformT &transform) {
  156|    385|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 385]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    385|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    385|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 368, False: 17]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|    368|    const MeshDecoder *const mesh_decoder =
  167|    368|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    368|    auto ret = CreateMeshPredictionScheme<
  170|    368|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    368|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    368|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    368|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 256, False: 112]
  ------------------
  174|    256|      return ret;
  175|    256|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    368|  }
  178|       |  // Create delta decoder.
  179|    129|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    129|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    385|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    145|      uint16_t bitstream_version) {
  143|    145|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    145|        method, attribute, transform, mesh_data, bitstream_version);
  145|    145|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    145|        uint16_t bitstream_version) {
  127|    145|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 143, False: 2]
  ------------------
  128|    143|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    143|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    143|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    143|                                                  mesh_data));
  132|    143|      }
  133|      2|      return nullptr;
  134|    145|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    115|      uint16_t bitstream_version) {
  143|    115|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    115|        method, attribute, transform, mesh_data, bitstream_version);
  145|    115|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    115|        uint16_t bitstream_version) {
  127|    115|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 113, False: 2]
  ------------------
  128|    113|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    113|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    113|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    113|                                                  mesh_data));
  132|    113|      }
  133|      2|      return nullptr;
  134|    115|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    443|                                 const PointCloudDecoder *decoder) {
  188|    443|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    443|      method, att_id, decoder, TransformT());
  190|    443|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    443|                                 const TransformT &transform) {
  156|    443|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 443]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    443|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    443|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 442, False: 1]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|    442|    const MeshDecoder *const mesh_decoder =
  167|    442|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    442|    auto ret = CreateMeshPredictionScheme<
  170|    442|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    442|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    442|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    442|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 267, False: 175]
  ------------------
  174|    267|      return ret;
  175|    267|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    442|  }
  178|       |  // Create delta decoder.
  179|    176|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    176|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    443|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    153|      uint16_t bitstream_version) {
  143|    153|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    153|        method, attribute, transform, mesh_data, bitstream_version);
  145|    153|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    153|        uint16_t bitstream_version) {
  111|    153|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 134, False: 19]
  ------------------
  112|    134|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    134|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    134|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    134|                                                  mesh_data));
  116|    134|      }
  117|     19|      return nullptr;
  118|    153|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    134|      uint16_t bitstream_version) {
  143|    134|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    134|        method, attribute, transform, mesh_data, bitstream_version);
  145|    134|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    134|        uint16_t bitstream_version) {
  111|    134|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 133, False: 1]
  ------------------
  112|    133|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    133|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    133|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    133|                                                  mesh_data));
  116|    133|      }
  117|      1|      return nullptr;
  118|    134|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  3.82k|                                 const PointCloudDecoder *decoder) {
  188|  3.82k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  3.82k|      method, att_id, decoder, TransformT());
  190|  3.82k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  3.82k|                                 const TransformT &transform) {
  156|  3.82k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 3.82k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  3.82k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  3.82k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 3.80k, False: 21]
  ------------------
  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|  3.80k|    const MeshDecoder *const mesh_decoder =
  167|  3.80k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  3.80k|    auto ret = CreateMeshPredictionScheme<
  170|  3.80k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  3.80k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  3.80k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  3.80k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 3.51k, False: 294]
  ------------------
  174|  3.51k|      return ret;
  175|  3.51k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  3.80k|  }
  178|       |  // Create delta decoder.
  179|    315|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    315|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  3.82k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.60k|      uint16_t bitstream_version) {
  143|  1.60k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.60k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.60k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.60k|        uint16_t bitstream_version) {
   53|  1.60k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 472, False: 1.13k]
  ------------------
   54|    472|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    472|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    472|                                                         MeshDataT>(
   57|    472|                attribute, transform, mesh_data));
   58|    472|      }
   59|  1.13k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.13k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 275, False: 859]
  ------------------
   61|    275|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    275|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    275|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    275|                                                  mesh_data));
   65|    275|      }
   66|    859|#endif
   67|    859|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 342, False: 517]
  ------------------
   68|    342|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    342|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    342|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    342|                                                  mesh_data));
   72|    342|      }
   73|    517|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    517|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 117, False: 400]
  ------------------
   75|    117|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    117|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    117|                                                     MeshDataT>(
   78|    117|                attribute, transform, mesh_data, bitstream_version));
   79|    117|      }
   80|    400|#endif
   81|    400|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 185, False: 215]
  ------------------
   82|    185|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    185|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    185|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    185|                                                  mesh_data));
   86|    185|      }
   87|    215|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    215|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 215, False: 0]
  ------------------
   89|    215|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    215|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    215|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    215|                                                  mesh_data));
   93|    215|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.60k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.90k|      uint16_t bitstream_version) {
  143|  1.90k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.90k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.90k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.90k|        uint16_t bitstream_version) {
   53|  1.90k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 468, False: 1.43k]
  ------------------
   54|    468|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    468|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    468|                                                         MeshDataT>(
   57|    468|                attribute, transform, mesh_data));
   58|    468|      }
   59|  1.43k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.43k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 362, False: 1.07k]
  ------------------
   61|    362|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    362|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    362|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    362|                                                  mesh_data));
   65|    362|      }
   66|  1.07k|#endif
   67|  1.07k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 361, False: 714]
  ------------------
   68|    361|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    361|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    361|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    361|                                                  mesh_data));
   72|    361|      }
   73|    714|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    714|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 121, False: 593]
  ------------------
   75|    121|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    121|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    121|                                                     MeshDataT>(
   78|    121|                attribute, transform, mesh_data, bitstream_version));
   79|    121|      }
   80|    593|#endif
   81|    593|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 190, False: 403]
  ------------------
   82|    190|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    190|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    190|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    190|                                                  mesh_data));
   86|    190|      }
   87|    403|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    403|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 403, False: 0]
  ------------------
   89|    403|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    403|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    403|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    403|                                                  mesh_data));
   93|    403|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.90k|    }

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     96|    const PointIndex *) {
   50|     96|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     96|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     96|  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|  24.5k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 24.4k, False: 96]
  ------------------
   57|  24.4k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  24.4k|                                           in_corr + i, out_data + i);
   59|  24.4k|  }
   60|     96|  return true;
   61|     96|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    144|    const PointIndex *) {
   50|    144|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    144|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    144|  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|   240k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 240k, False: 144]
  ------------------
   57|   240k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   240k|                                           in_corr + i, out_data + i);
   59|   240k|  }
   60|    144|  return true;
   61|    144|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    315|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    232|    const PointIndex *) {
   50|    232|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    232|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    232|  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.7M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 18.7M, False: 232]
  ------------------
   57|  18.7M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  18.7M|                                           in_corr + i, out_data + i);
   59|  18.7M|  }
   60|    232|  return true;
   61|    232|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    129|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    176|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    368|    uint16_t bitstream_version) {
   38|    368|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    368|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 368, False: 0]
  ------------------
   40|    368|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 5, False: 363]
  ------------------
   41|    363|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 23, False: 340]
  ------------------
   42|    340|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 340]
  ------------------
   43|    340|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 23, False: 317]
  ------------------
   44|    317|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 256, False: 61]
  ------------------
   45|    354|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 47, False: 14]
  ------------------
   46|    354|    const CornerTable *const ct = source->GetCornerTable();
   47|    354|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    354|        source->GetAttributeEncodingData(att_id);
   49|    354|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 94, False: 260]
  |  Branch (49:26): [True: 0, False: 260]
  ------------------
   50|       |      // No connectivity data found.
   51|     94|      return nullptr;
   52|     94|    }
   53|       |    // Connectivity data exists.
   54|    260|    const MeshAttributeCornerTable *const att_ct =
   55|    260|        source->GetAttributeCornerTable(att_id);
   56|    260|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 145, False: 115]
  ------------------
   57|    145|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    145|      MeshData md;
   59|    145|      md.Set(source->mesh(), att_ct,
   60|    145|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    145|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    145|      MeshPredictionSchemeFactoryT factory;
   63|    145|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    145|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 143, False: 2]
  ------------------
   65|    143|        return ret;
   66|    143|      }
   67|    145|    } else {
   68|    115|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    115|      MeshData md;
   70|    115|      md.Set(source->mesh(), ct,
   71|    115|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    115|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    115|      MeshPredictionSchemeFactoryT factory;
   74|    115|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    115|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 113, False: 2]
  ------------------
   76|    113|        return ret;
   77|    113|      }
   78|    115|    }
   79|    260|  }
   80|     18|  return nullptr;
   81|    368|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    442|    uint16_t bitstream_version) {
   38|    442|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    442|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 442, False: 0]
  ------------------
   40|    442|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 35, False: 407]
  ------------------
   41|    407|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 9, False: 398]
  ------------------
   42|    398|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 3, False: 395]
  ------------------
   43|    395|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 41, False: 354]
  ------------------
   44|    354|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 293, False: 61]
  ------------------
   45|    429|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 48, False: 13]
  ------------------
   46|    429|    const CornerTable *const ct = source->GetCornerTable();
   47|    429|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    429|        source->GetAttributeEncodingData(att_id);
   49|    429|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 142, False: 287]
  |  Branch (49:26): [True: 0, False: 287]
  ------------------
   50|       |      // No connectivity data found.
   51|    142|      return nullptr;
   52|    142|    }
   53|       |    // Connectivity data exists.
   54|    287|    const MeshAttributeCornerTable *const att_ct =
   55|    287|        source->GetAttributeCornerTable(att_id);
   56|    287|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 153, False: 134]
  ------------------
   57|    153|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    153|      MeshData md;
   59|    153|      md.Set(source->mesh(), att_ct,
   60|    153|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    153|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    153|      MeshPredictionSchemeFactoryT factory;
   63|    153|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    153|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 134, False: 19]
  ------------------
   65|    134|        return ret;
   66|    134|      }
   67|    153|    } else {
   68|    134|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    134|      MeshData md;
   70|    134|      md.Set(source->mesh(), ct,
   71|    134|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    134|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    134|      MeshPredictionSchemeFactoryT factory;
   74|    134|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    134|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 133, False: 1]
  ------------------
   76|    133|        return ret;
   77|    133|      }
   78|    134|    }
   79|    287|  }
   80|     33|  return nullptr;
   81|    442|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  3.80k|    uint16_t bitstream_version) {
   38|  3.80k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  3.80k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 3.80k, False: 0]
  ------------------
   40|  3.80k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.02k, False: 2.78k]
  ------------------
   41|  2.78k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 648, False: 2.13k]
  ------------------
   42|  2.13k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 729, False: 1.40k]
  ------------------
   43|  1.40k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 389, False: 1.01k]
  ------------------
   44|  1.01k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 627, False: 390]
  ------------------
   45|  3.65k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 243, False: 147]
  ------------------
   46|  3.65k|    const CornerTable *const ct = source->GetCornerTable();
   47|  3.65k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  3.65k|        source->GetAttributeEncodingData(att_id);
   49|  3.65k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 147, False: 3.51k]
  |  Branch (49:26): [True: 0, False: 3.51k]
  ------------------
   50|       |      // No connectivity data found.
   51|    147|      return nullptr;
   52|    147|    }
   53|       |    // Connectivity data exists.
   54|  3.51k|    const MeshAttributeCornerTable *const att_ct =
   55|  3.51k|        source->GetAttributeCornerTable(att_id);
   56|  3.51k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.60k, False: 1.90k]
  ------------------
   57|  1.60k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.60k|      MeshData md;
   59|  1.60k|      md.Set(source->mesh(), att_ct,
   60|  1.60k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.60k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.60k|      MeshPredictionSchemeFactoryT factory;
   63|  1.60k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.60k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.60k, False: 0]
  ------------------
   65|  1.60k|        return ret;
   66|  1.60k|      }
   67|  1.90k|    } else {
   68|  1.90k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.90k|      MeshData md;
   70|  1.90k|      md.Set(source->mesh(), ct,
   71|  1.90k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.90k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.90k|      MeshPredictionSchemeFactoryT factory;
   74|  1.90k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.90k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.90k, False: 0]
  ------------------
   76|  1.90k|        return ret;
   77|  1.90k|      }
   78|  1.90k|    }
   79|  3.51k|  }
   80|    147|  return nullptr;
   81|  3.80k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   791k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   791k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 543k, False: 248k]
  |  Branch (93:22): [True: 492k, False: 50.9k]
  ------------------
   94|   492k|      return true;
   95|   492k|    }
   96|   298k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 99.2k, False: 199k]
  |  Branch (96:25): [True: 48.0k, False: 51.1k]
  ------------------
   97|   791k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   791k|  int32_t GetRotationCount(Point2 pred) const {
   51|   791k|    const DataType sign_x = pred[0];
   52|   791k|    const DataType sign_y = pred[1];
   53|       |
   54|   791k|    int32_t rotation_count = 0;
   55|   791k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 543k, False: 248k]
  ------------------
   56|   543k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 492k, False: 50.9k]
  ------------------
   57|   492k|        rotation_count = 0;
   58|   492k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 25.8k, False: 25.0k]
  ------------------
   59|  25.8k|        rotation_count = 3;
   60|  25.8k|      } else {
   61|  25.0k|        rotation_count = 1;
   62|  25.0k|      }
   63|   543k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 148k, False: 99.2k]
  ------------------
   64|   148k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 98.3k, False: 50.4k]
  ------------------
   65|  98.3k|        rotation_count = 2;
   66|  98.3k|      } else {
   67|  50.4k|        rotation_count = 1;
   68|  50.4k|      }
   69|   148k|    } else {
   70|  99.2k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 48.0k, False: 51.1k]
  ------------------
   71|  48.0k|        rotation_count = 0;
   72|  51.1k|      } else {
   73|  51.1k|        rotation_count = 3;
   74|  51.1k|      }
   75|  99.2k|    }
   76|   791k|    return rotation_count;
   77|   791k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   501k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   501k|    switch (rotation_count) {
   81|   152k|      case 1:
  ------------------
  |  Branch (81:7): [True: 152k, False: 349k]
  ------------------
   82|   152k|        return Point2(p[1], -p[0]);
   83|   196k|      case 2:
  ------------------
  |  Branch (83:7): [True: 196k, False: 305k]
  ------------------
   84|   196k|        return Point2(-p[0], -p[1]);
   85|   152k|      case 3:
  ------------------
  |  Branch (85:7): [True: 152k, False: 349k]
  ------------------
   86|   152k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 501k]
  ------------------
   88|      0|        return p;
   89|   501k|    }
   90|   501k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    443|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  3.64k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  3.22k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  3.22k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  3.22k|  bool InitCorrectionBounds() {
   84|  3.22k|    const int64_t dif =
   85|  3.22k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  3.22k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 3.22k]
  |  Branch (86:20): [True: 16, False: 3.20k]
  ------------------
   87|     16|      return false;
   88|     16|    }
   89|  3.20k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  3.20k|    max_correction_ = max_dif_ / 2;
   91|  3.20k|    min_correction_ = -max_correction_;
   92|  3.20k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 1.41k, False: 1.79k]
  ------------------
   93|  1.41k|      max_correction_ -= 1;
   94|  1.41k|    }
   95|  3.20k|    return true;
   96|  3.22k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  2.60k|  void Init(int num_components) {
   56|  2.60k|    num_components_ = num_components;
   57|  2.60k|    clamped_value_.resize(num_components);
   58|  2.60k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  25.7M|      const DataTypeT *predicted_val) const {
   64|   429M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 403M, False: 25.7M]
  ------------------
   65|   403M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 301k, False: 403M]
  ------------------
   66|   301k|        clamped_value_[i] = max_value_;
   67|   403M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 4.83M, False: 398M]
  ------------------
   68|  4.83M|        clamped_value_[i] = min_value_;
   69|   398M|      } else {
   70|   398M|        clamped_value_[i] = predicted_val[i];
   71|   398M|      }
   72|   403M|    }
   73|  25.7M|    return clamped_value_.data();
   74|  25.7M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   859M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   403M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|  1.14M|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   403M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    531|  int quantization_bits() const {
   78|    531|    DRACO_DCHECK(false);
   79|    531|    return -1;
   80|    531|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  3.82k|      : num_components_(0),
   45|  3.82k|        min_value_(0),
   46|  3.82k|        max_value_(0),
   47|  3.82k|        max_dif_(0),
   48|  3.82k|        max_correction_(0),
   49|  3.82k|        min_correction_(0) {}

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  6.33k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|   102M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  4.65k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  21.9k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  7.18k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  7.18k|    portable_attribute_ = std::move(att);
   71|  7.18k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  23.9k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  14.7k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  24.6k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  4.39k|    DecoderBuffer *buffer) {
   30|  4.39k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 243, False: 4.15k]
  ------------------
   31|    243|    return false;
   32|    243|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  4.15k|  const int32_t num_attributes = GetNumAttributes();
   35|  4.15k|  sequential_decoders_.resize(num_attributes);
   36|  18.8k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 14.7k, False: 4.12k]
  ------------------
   37|  14.7k|    uint8_t decoder_type;
   38|  14.7k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 7, False: 14.7k]
  ------------------
   39|      7|      return false;
   40|      7|    }
   41|       |    // Create the decoder from the id.
   42|  14.7k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  14.7k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 12, False: 14.7k]
  ------------------
   44|     12|      return false;
   45|     12|    }
   46|  14.7k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 8, False: 14.7k]
  ------------------
   47|      8|      return false;
   48|      8|    }
   49|  14.7k|  }
   50|  4.12k|  return true;
   51|  4.15k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  3.80k|    DecoderBuffer *buffer) {
   55|  3.80k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 3.80k]
  |  Branch (55:22): [True: 6, False: 3.80k]
  ------------------
   56|      6|    return false;
   57|      6|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  3.80k|  const int32_t num_attributes = GetNumAttributes();
   60|  18.0k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 14.2k, False: 3.80k]
  ------------------
   61|  14.2k|    PointAttribute *const pa =
   62|  14.2k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  14.2k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 14.2k]
  ------------------
   64|      0|      return false;
   65|      0|    }
   66|  14.2k|  }
   67|  3.80k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  3.80k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  3.80k|    DecoderBuffer *in_buffer) {
   72|  3.80k|  const int32_t num_attributes = GetNumAttributes();
   73|  10.6k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 8.54k, False: 2.13k]
  ------------------
   74|  8.54k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 1.66k, False: 6.88k]
  ------------------
   75|  8.54k|                                                          in_buffer)) {
   76|  1.66k|      return false;
   77|  1.66k|    }
   78|  8.54k|  }
   79|  2.13k|  return true;
   80|  3.80k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  2.13k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  2.13k|  const int32_t num_attributes = GetNumAttributes();
   85|  5.73k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 3.97k, False: 1.76k]
  ------------------
   86|  3.97k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 374, False: 3.59k]
  ------------------
   87|  3.97k|            point_ids_, in_buffer)) {
   88|    374|      return false;
   89|    374|    }
   90|  3.97k|  }
   91|  1.76k|  return true;
   92|  2.13k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.76k|    TransformAttributesToOriginalFormat() {
   96|  1.76k|  const int32_t num_attributes = GetNumAttributes();
   97|  4.70k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 3.27k, False: 1.42k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  3.27k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 3.27k, False: 0]
  ------------------
  100|  3.27k|      const PointAttribute *const attribute =
  101|  3.27k|          sequential_decoders_[i]->attribute();
  102|  3.27k|      const PointAttribute *const portable_attribute =
  103|  3.27k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  3.27k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 2.67k, False: 608]
  |  Branch (104:11): [True: 883, False: 2.39k]
  ------------------
  105|  2.67k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 883, False: 1.78k]
  ------------------
  106|  2.67k|              attribute->attribute_type(), "skip_attribute_transform", false)) {
  107|       |        // Attribute transform should not be performed. In this case, we replace
  108|       |        // the output geometry attribute with the portable attribute.
  109|       |        // TODO(ostava): We can potentially avoid this copy by introducing a new
  110|       |        // mechanism that would allow to use the final attributes as portable
  111|       |        // attributes for predictors that may need them.
  112|    883|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|    883|        continue;
  114|    883|      }
  115|  3.27k|    }
  116|  2.39k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 338, False: 2.05k]
  ------------------
  117|  2.39k|            point_ids_)) {
  118|    338|      return false;
  119|    338|    }
  120|  2.39k|  }
  121|  1.42k|  return true;
  122|  1.76k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  14.7k|    uint8_t decoder_type) {
  127|  14.7k|  switch (decoder_type) {
  128|  2.14k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 2.14k, False: 12.6k]
  ------------------
  129|  2.14k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  2.14k|          new SequentialAttributeDecoder());
  131|  11.4k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 11.4k, False: 3.28k]
  ------------------
  132|  11.4k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  11.4k|          new SequentialIntegerAttributeDecoder());
  134|    176|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 176, False: 14.5k]
  ------------------
  135|    176|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    176|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|    950|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 950, False: 13.8k]
  ------------------
  139|    950|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|    950|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     12|    default:
  ------------------
  |  Branch (142:5): [True: 12, False: 14.7k]
  ------------------
  143|     12|      break;
  144|  14.7k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     12|  return nullptr;
  147|  14.7k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  12.6k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  12.6k|                                             int attribute_id) {
   27|  12.6k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 12.6k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  12.6k|  return true;
   31|  12.6k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  1.78k|    const std::vector<PointIndex> &point_ids) {
   35|  1.78k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  1.78k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 1.78k, False: 0]
  ------------------
   37|  1.78k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.78k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 1.78k]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|  1.78k|#endif
   41|  1.78k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  1.78k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  7.51k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  7.51k|  int8_t prediction_scheme_method;
   48|  7.51k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 35, False: 7.48k]
  ------------------
   49|     35|    return false;
   50|     35|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  7.48k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 47, False: 7.43k]
  ------------------
   53|  7.43k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 107, False: 7.32k]
  ------------------
   54|    154|    return false;
   55|    154|  }
   56|  7.32k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 7.31k, False: 8]
  ------------------
   57|  7.31k|    int8_t prediction_transform_type;
   58|  7.31k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 20, False: 7.29k]
  ------------------
   59|     20|      return false;
   60|     20|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  7.29k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 20, False: 7.27k]
  ------------------
   63|  7.27k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 80, False: 7.19k]
  ------------------
   64|    100|      return false;
   65|    100|    }
   66|  7.19k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  7.19k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  7.19k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  7.19k|  }
   70|       |
   71|  7.20k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 4.65k, False: 2.55k]
  ------------------
   72|  4.65k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 18, False: 4.63k]
  ------------------
   73|     18|      return false;
   74|     18|    }
   75|  4.65k|  }
   76|       |
   77|  7.18k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 1.26k, False: 5.92k]
  ------------------
   78|  1.26k|    return false;
   79|  1.26k|  }
   80|       |
   81|  5.92k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  5.92k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  5.92k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 5.92k, False: 0]
  ------------------
   84|  5.92k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  5.92k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 0, False: 5.92k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|      0|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 0]
  ------------------
   87|      0|      return false;
   88|      0|    }
   89|      0|  }
   90|  5.92k|#endif
   91|  5.92k|  return true;
   92|  5.92k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  6.34k|    PredictionSchemeTransformType transform_type) {
   98|  6.34k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 2.52k, False: 3.82k]
  ------------------
   99|  2.52k|    return nullptr;  // For now we support only wrap transform.
  100|  2.52k|  }
  101|  3.82k|  return CreatePredictionSchemeForDecoder<
  102|  3.82k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  3.82k|      method, attribute_id(), decoder());
  104|  6.34k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  7.18k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  7.18k|  const int num_components = GetNumValueComponents();
  109|  7.18k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 7.18k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  7.18k|  const size_t num_entries = point_ids.size();
  113|  7.18k|  const size_t num_values = num_entries * num_components;
  114|  7.18k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  7.18k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  7.18k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 6, False: 7.18k]
  ------------------
  117|      6|    return false;
  118|      6|  }
  119|  7.18k|  uint8_t compressed;
  120|  7.18k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 12, False: 7.17k]
  ------------------
  121|     12|    return false;
  122|     12|  }
  123|  7.17k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 534, False: 6.63k]
  ------------------
  124|       |    // Decode compressed values.
  125|    534|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 198, False: 336]
  ------------------
  126|    534|                       in_buffer,
  127|    534|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    198|      return false;
  129|    198|    }
  130|  6.63k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  6.63k|    uint8_t num_bytes;
  134|  6.63k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 7, False: 6.63k]
  ------------------
  135|      7|      return false;
  136|      7|    }
  137|  6.63k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 367, False: 6.26k]
  ------------------
  138|    367|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 367]
  ------------------
  139|    367|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    367|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 9, False: 358]
  ------------------
  143|    367|                             sizeof(int32_t) * num_values)) {
  144|      9|        return false;
  145|      9|      }
  146|  6.26k|    } else {
  147|  6.26k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 26, False: 6.23k]
  ------------------
  148|  6.26k|          num_bytes * num_values) {
  149|     26|        return false;
  150|     26|      }
  151|  6.23k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 36, False: 6.20k]
  ------------------
  152|  6.23k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     36|        return false;
  154|     36|      }
  155|   952M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 952M, False: 6.20k]
  ------------------
  156|   952M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 952M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   952M|      }
  160|  6.20k|    }
  161|  6.63k|  }
  162|       |
  163|  6.89k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 6.89k, False: 0]
  |  Branch (163:26): [True: 2.45k, False: 4.44k]
  ------------------
  164|  6.09k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 3.64k, False: 799]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  6.09k|    ConvertSymbolsToSignedInts(
  167|  6.09k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  6.09k|        static_cast<int>(num_values), portable_attribute_data);
  169|  6.09k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  6.89k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 4.44k, False: 2.45k]
  ------------------
  173|  4.44k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 586, False: 3.85k]
  ------------------
  174|    586|      return false;
  175|    586|    }
  176|       |
  177|  3.85k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 3.85k, False: 0]
  ------------------
  178|  3.85k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 387, False: 3.46k]
  ------------------
  179|  3.85k|              portable_attribute_data, portable_attribute_data,
  180|  3.85k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    387|        return false;
  182|    387|      }
  183|  3.85k|    }
  184|  3.85k|  }
  185|  5.92k|  return true;
  186|  6.89k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  1.38k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  1.38k|  switch (attribute()->data_type()) {
  190|    119|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 119, False: 1.26k]
  ------------------
  191|    119|      StoreTypedValues<uint8_t>(num_values);
  192|    119|      break;
  193|    638|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 638, False: 743]
  ------------------
  194|    638|      StoreTypedValues<int8_t>(num_values);
  195|    638|      break;
  196|     92|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 92, False: 1.28k]
  ------------------
  197|     92|      StoreTypedValues<uint16_t>(num_values);
  198|     92|      break;
  199|    188|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 188, False: 1.19k]
  ------------------
  200|    188|      StoreTypedValues<int16_t>(num_values);
  201|    188|      break;
  202|    144|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 144, False: 1.23k]
  ------------------
  203|    144|      StoreTypedValues<uint32_t>(num_values);
  204|    144|      break;
  205|     97|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 97, False: 1.28k]
  ------------------
  206|     97|      StoreTypedValues<int32_t>(num_values);
  207|     97|      break;
  208|    103|    default:
  ------------------
  |  Branch (208:5): [True: 103, False: 1.27k]
  ------------------
  209|    103|      return false;
  210|  1.38k|  }
  211|  1.27k|  return true;
  212|  1.38k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  7.18k|    int num_entries, int num_components) {
  237|  7.18k|  GeometryAttribute ga;
  238|  7.18k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  7.18k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  7.18k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  7.18k|  port_att->SetIdentityMapping();
  242|  7.18k|  port_att->Reset(num_entries);
  243|  7.18k|  port_att->set_unique_id(attribute()->unique_id());
  244|  7.18k|  SetPortableAttribute(std::move(port_att));
  245|  7.18k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    119|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    119|  const int num_components = attribute()->num_components();
  217|    119|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    119|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    119|      new AttributeTypeT[num_components]);
  220|    119|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    119|  int val_id = 0;
  222|    119|  int out_byte_pos = 0;
  223|   335k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 335k, False: 119]
  ------------------
  224|  18.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 18.2M, False: 335k]
  ------------------
  225|  18.2M|      const AttributeTypeT value =
  226|  18.2M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  18.2M|      att_val[c] = value;
  228|  18.2M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   335k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   335k|    out_byte_pos += entry_size;
  232|   335k|  }
  233|    119|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    638|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    638|  const int num_components = attribute()->num_components();
  217|    638|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    638|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    638|      new AttributeTypeT[num_components]);
  220|    638|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    638|  int val_id = 0;
  222|    638|  int out_byte_pos = 0;
  223|  88.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 88.5M, False: 638]
  ------------------
  224|   229M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 140M, False: 88.5M]
  ------------------
  225|   140M|      const AttributeTypeT value =
  226|   140M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   140M|      att_val[c] = value;
  228|   140M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  88.5M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  88.5M|    out_byte_pos += entry_size;
  232|  88.5M|  }
  233|    638|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|     92|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     92|  const int num_components = attribute()->num_components();
  217|     92|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     92|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     92|      new AttributeTypeT[num_components]);
  220|     92|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     92|  int val_id = 0;
  222|     92|  int out_byte_pos = 0;
  223|   872k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 872k, False: 92]
  ------------------
  224|  49.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 48.9M, False: 872k]
  ------------------
  225|  48.9M|      const AttributeTypeT value =
  226|  48.9M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  48.9M|      att_val[c] = value;
  228|  48.9M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   872k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   872k|    out_byte_pos += entry_size;
  232|   872k|  }
  233|     92|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    188|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    188|  const int num_components = attribute()->num_components();
  217|    188|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    188|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    188|      new AttributeTypeT[num_components]);
  220|    188|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    188|  int val_id = 0;
  222|    188|  int out_byte_pos = 0;
  223|   809k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 809k, False: 188]
  ------------------
  224|  44.3M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 43.5M, False: 809k]
  ------------------
  225|  43.5M|      const AttributeTypeT value =
  226|  43.5M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  43.5M|      att_val[c] = value;
  228|  43.5M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   809k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   809k|    out_byte_pos += entry_size;
  232|   809k|  }
  233|    188|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    144|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    144|  const int num_components = attribute()->num_components();
  217|    144|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    144|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    144|      new AttributeTypeT[num_components]);
  220|    144|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    144|  int val_id = 0;
  222|    144|  int out_byte_pos = 0;
  223|  1.05M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.05M, False: 144]
  ------------------
  224|   139M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 138M, False: 1.05M]
  ------------------
  225|   138M|      const AttributeTypeT value =
  226|   138M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   138M|      att_val[c] = value;
  228|   138M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.05M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.05M|    out_byte_pos += entry_size;
  232|  1.05M|  }
  233|    144|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|     97|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     97|  const int num_components = attribute()->num_components();
  217|     97|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     97|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     97|      new AttributeTypeT[num_components]);
  220|     97|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     97|  int val_id = 0;
  222|     97|  int out_byte_pos = 0;
  223|  11.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 11.0M, False: 97]
  ------------------
  224|  77.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 66.3M, False: 11.0M]
  ------------------
  225|  66.3M|      const AttributeTypeT value =
  226|  66.3M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  66.3M|      att_val[c] = value;
  228|  66.3M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  11.0M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  11.0M|    out_byte_pos += entry_size;
  232|  11.0M|  }
  233|     97|}

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  6.17M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  6.17M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  6.17M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  6.17M|    const int remaining = 32 - num_used_bits_;
   54|  6.17M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 4.21M, False: 1.95M]
  ------------------
   55|  4.21M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 3.90M, False: 315k]
  ------------------
   56|  3.90M|        return false;
   57|  3.90M|      }
   58|   315k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   315k|      num_used_bits_ += nbits;
   60|   315k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 10.3k, False: 305k]
  ------------------
   61|  10.3k|        ++pos_;
   62|  10.3k|        num_used_bits_ = 0;
   63|  10.3k|      }
   64|  1.95M|    } else {
   65|  1.95M|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 1.94M, False: 10.5k]
  ------------------
   66|  1.94M|        return false;
   67|  1.94M|      }
   68|  10.5k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  10.5k|      num_used_bits_ = nbits - remaining;
   70|  10.5k|      ++pos_;
   71|  10.5k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  10.5k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  10.5k|    }
   74|   325k|    return true;
   75|  6.17M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  7.44M|  bool DecodeNextBit() {
   35|  7.44M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  7.44M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 7.08M, False: 356k]
  ------------------
   37|  7.08M|      return false;
   38|  7.08M|    }
   39|   356k|    const bool bit = *pos_ & selector;
   40|   356k|    ++num_used_bits_;
   41|   356k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 10.9k, False: 345k]
  ------------------
   42|  10.9k|      ++pos_;
   43|  10.9k|      num_used_bits_ = 0;
   44|  10.9k|    }
   45|   356k|    return bit;
   46|  7.44M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    614|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    516|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    345|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  8.20k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 7.97k, False: 223]
  ------------------
   35|  7.97k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 122, False: 7.85k]
  ------------------
   36|    122|        return false;
   37|    122|      }
   38|  7.97k|    }
   39|    223|    return bit_decoder_.StartDecoding(source_buffer);
   40|    345|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.31M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.31M|    uint32_t result = 0;
   49|  14.7M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 12.3M, False: 2.31M]
  ------------------
   50|  12.3M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  12.3M|      result = (result << 1) + bit;
   52|  12.3M|    }
   53|  2.31M|    *value = result;
   54|  2.31M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     95|  void EndDecoding() {
   57|  3.13k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 3.04k, False: 95]
  ------------------
   58|  3.04k|      folded_number_decoders_[i].EndDecoding();
   59|  3.04k|    }
   60|     95|    bit_decoder_.EndDecoding();
   61|     95|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    516|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  45.5k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  24.1k|                                const uint8_t *const buf, int offset) {
  301|  24.1k|  unsigned x;
  302|  24.1k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 41, False: 24.0k]
  ------------------
  303|     41|    return 1;
  304|     41|  }
  305|  24.0k|  ans->buf = buf;
  306|  24.0k|  x = buf[offset - 1] >> 6;
  307|  24.0k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 20.9k, False: 3.08k]
  ------------------
  308|  20.9k|    ans->buf_offset = offset - 1;
  309|  20.9k|    ans->state = buf[offset - 1] & 0x3F;
  310|  20.9k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.82k, False: 262]
  ------------------
  311|  2.82k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 9, False: 2.81k]
  ------------------
  312|      9|      return 1;
  313|      9|    }
  314|  2.81k|    ans->buf_offset = offset - 2;
  315|  2.81k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.81k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 248, False: 14]
  ------------------
  317|    248|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 3, False: 245]
  ------------------
  318|      3|      return 1;
  319|      3|    }
  320|    245|    ans->buf_offset = offset - 3;
  321|    245|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    245|  } else {
  323|     14|    return 1;
  324|     14|  }
  325|  24.0k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  24.0k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  24.0k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  24.0k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  24.0k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 3, False: 24.0k]
  ------------------
  327|      3|    return 1;
  328|      3|  }
  329|  24.0k|  return 0;
  330|  24.0k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.81k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.81k|  uint32_t val;
   69|  2.81k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.81k|  val = mem[1] << 8;
   72|  2.81k|  val |= mem[0];
   73|  2.81k|  return val;
   74|  2.81k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    245|static uint32_t mem_get_le24(const void *vmem) {
   77|    245|  uint32_t val;
   78|    245|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    245|  val = mem[2] << 16;
   81|    245|  val |= mem[1] << 8;
   82|    245|  val |= mem[0];
   83|    245|  return val;
   84|    245|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  4.97G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  4.97G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  4.97G|  unsigned quot, rem, x, xn;
  172|  4.97G|#endif
  173|  4.97G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  4.97G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  4.97G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  9.95G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 4.42G, False: 557M]
  |  Branch (174:40): [True: 104k, False: 4.42G]
  ------------------
  175|   104k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   104k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   104k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  4.97G|  x = ans->state;
  184|  4.97G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  4.97G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  4.97G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  4.97G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  4.97G|  xn = quot * p;
  187|  4.97G|  val = rem < p;
  188|  4.97G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  9.95G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 4.42G, False: 552M]
  |  |  ------------------
  ------------------
  189|  4.42G|    ans->state = xn + rem;
  190|  4.42G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   552M|    ans->state = x - xn - p;
  193|   552M|  }
  194|  4.97G|#endif
  195|  4.97G|  return val;
  196|  4.97G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  62.6k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  62.6k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  62.6k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  62.6k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  4.08k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  2.21k|                                       uint32_t num_symbols) {
  482|  2.21k|    lut_table_.resize(rans_precision);
  483|  2.21k|    probability_table_.resize(num_symbols);
  484|  2.21k|    uint32_t cum_prob = 0;
  485|  2.21k|    uint32_t act_prob = 0;
  486|  23.6k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 21.6k, False: 2.01k]
  ------------------
  487|  21.6k|      probability_table_[i].prob = token_probs[i];
  488|  21.6k|      probability_table_[i].cum_prob = cum_prob;
  489|  21.6k|      cum_prob += token_probs[i];
  490|  21.6k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 199, False: 21.4k]
  ------------------
  491|    199|        return false;
  492|    199|      }
  493|  7.60M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 7.57M, False: 21.4k]
  ------------------
  494|  7.57M|        lut_table_[j] = i;
  495|  7.57M|      }
  496|  21.4k|      act_prob = cum_prob;
  497|  21.4k|    }
  498|  2.01k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 214, False: 1.80k]
  ------------------
  499|    214|      return false;
  500|    214|    }
  501|  1.80k|    return true;
  502|  2.01k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.46k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.46k|    unsigned x;
  423|  1.46k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 120, False: 1.34k]
  ------------------
  424|    120|      return 1;
  425|    120|    }
  426|  1.34k|    ans_.buf = buf;
  427|  1.34k|    x = buf[offset - 1] >> 6;
  428|  1.34k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 831, False: 514]
  ------------------
  429|    831|      ans_.buf_offset = offset - 1;
  430|    831|      ans_.state = buf[offset - 1] & 0x3F;
  431|    831|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 193, False: 321]
  ------------------
  432|    193|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 36, False: 157]
  ------------------
  433|     36|        return 1;
  434|     36|      }
  435|    157|      ans_.buf_offset = offset - 2;
  436|    157|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    321|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 207, False: 114]
  ------------------
  438|    207|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 36, False: 171]
  ------------------
  439|     36|        return 1;
  440|     36|      }
  441|    171|      ans_.buf_offset = offset - 3;
  442|    171|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    171|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 114, False: 0]
  ------------------
  444|    114|      ans_.buf_offset = offset - 4;
  445|    114|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    114|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.27k|    ans_.state += l_rans_base;
  450|  1.27k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.27k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 110, False: 1.16k]
  ------------------
  451|    110|      return 1;
  452|    110|    }
  453|  1.16k|    return 0;
  454|  1.27k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    253|static uint32_t mem_get_le16(const void *vmem) {
   68|    253|  uint32_t val;
   69|    253|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    253|  val = mem[1] << 8;
   72|    253|  val |= mem[0];
   73|    253|  return val;
   74|    253|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    284|static uint32_t mem_get_le24(const void *vmem) {
   77|    284|  uint32_t val;
   78|    284|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    284|  val = mem[2] << 16;
   81|    284|  val |= mem[1] << 8;
   82|    284|  val |= mem[0];
   83|    284|  return val;
   84|    284|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    350|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    350|  uint32_t val;
   88|    350|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    350|  val = mem[3] << 24;
   91|    350|  val |= mem[2] << 16;
   92|    350|  val |= mem[1] << 8;
   93|    350|  val |= mem[0];
   94|    350|  return val;
   95|    350|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  77.2M|  inline int rans_read() {
  463|  77.2M|    unsigned rem;
  464|  77.2M|    unsigned quo;
  465|  77.2M|    struct rans_dec_sym sym;
  466|  77.3M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 68.0M, False: 9.25M]
  |  Branch (466:40): [True: 20.9k, False: 68.0M]
  ------------------
  467|  20.9k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  20.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  20.9k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  77.2M|    quo = ans_.state / rans_precision;
  472|  77.2M|    rem = ans_.state % rans_precision;
  473|  77.2M|    fetch_sym(&sym, rem);
  474|  77.2M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  77.2M|    return sym.val;
  476|  77.2M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  77.2M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  77.2M|    uint32_t symbol = lut_table_[rem];
  507|  77.2M|    out->val = symbol;
  508|  77.2M|    out->prob = probability_table_[symbol].prob;
  509|  77.2M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  77.2M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.09k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    309|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    179|                                       uint32_t num_symbols) {
  482|    179|    lut_table_.resize(rans_precision);
  483|    179|    probability_table_.resize(num_symbols);
  484|    179|    uint32_t cum_prob = 0;
  485|    179|    uint32_t act_prob = 0;
  486|  2.90k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.75k, False: 147]
  ------------------
  487|  2.75k|      probability_table_[i].prob = token_probs[i];
  488|  2.75k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.75k|      cum_prob += token_probs[i];
  490|  2.75k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 32, False: 2.72k]
  ------------------
  491|     32|        return false;
  492|     32|      }
  493|  1.07M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.07M, False: 2.72k]
  ------------------
  494|  1.07M|        lut_table_[j] = i;
  495|  1.07M|      }
  496|  2.72k|      act_prob = cum_prob;
  497|  2.72k|    }
  498|    147|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 30, False: 117]
  ------------------
  499|     30|      return false;
  500|     30|    }
  501|    117|    return true;
  502|    147|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     60|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     60|    unsigned x;
  423|     60|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 59]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     59|    ans_.buf = buf;
  427|     59|    x = buf[offset - 1] >> 6;
  428|     59|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 29, False: 30]
  ------------------
  429|     29|      ans_.buf_offset = offset - 1;
  430|     29|      ans_.state = buf[offset - 1] & 0x3F;
  431|     30|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 7, False: 23]
  ------------------
  432|      7|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 6]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     23|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 11]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 6, False: 6]
  ------------------
  439|      6|        return 1;
  440|      6|      }
  441|      6|      ans_.buf_offset = offset - 3;
  442|      6|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     11|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 11, False: 0]
  ------------------
  444|     11|      ans_.buf_offset = offset - 4;
  445|     11|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     11|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     52|    ans_.state += l_rans_base;
  450|     52|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     52|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 9, False: 43]
  ------------------
  451|      9|      return 1;
  452|      9|    }
  453|     43|    return 0;
  454|     52|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|   133k|  inline int rans_read() {
  463|   133k|    unsigned rem;
  464|   133k|    unsigned quo;
  465|   133k|    struct rans_dec_sym sym;
  466|   134k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 43.5k, False: 91.0k]
  |  Branch (466:40): [True: 1.11k, False: 42.4k]
  ------------------
  467|  1.11k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.11k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.11k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   133k|    quo = ans_.state / rans_precision;
  472|   133k|    rem = ans_.state % rans_precision;
  473|   133k|    fetch_sym(&sym, rem);
  474|   133k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   133k|    return sym.val;
  476|   133k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|   133k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   133k|    uint32_t symbol = lut_table_[rem];
  507|   133k|    out->val = symbol;
  508|   133k|    out->prob = probability_table_[symbol].prob;
  509|   133k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   133k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     43|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    315|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    176|                                       uint32_t num_symbols) {
  482|    176|    lut_table_.resize(rans_precision);
  483|    176|    probability_table_.resize(num_symbols);
  484|    176|    uint32_t cum_prob = 0;
  485|    176|    uint32_t act_prob = 0;
  486|  7.90k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 7.75k, False: 155]
  ------------------
  487|  7.75k|      probability_table_[i].prob = token_probs[i];
  488|  7.75k|      probability_table_[i].cum_prob = cum_prob;
  489|  7.75k|      cum_prob += token_probs[i];
  490|  7.75k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 21, False: 7.72k]
  ------------------
  491|     21|        return false;
  492|     21|      }
  493|  4.45M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 4.44M, False: 7.72k]
  ------------------
  494|  4.44M|        lut_table_[j] = i;
  495|  4.44M|      }
  496|  7.72k|      act_prob = cum_prob;
  497|  7.72k|    }
  498|    155|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 32, False: 123]
  ------------------
  499|     32|      return false;
  500|     32|    }
  501|    123|    return true;
  502|    155|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     84|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     84|    unsigned x;
  423|     84|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 83]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     83|    ans_.buf = buf;
  427|     83|    x = buf[offset - 1] >> 6;
  428|     83|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 27, False: 56]
  ------------------
  429|     27|      ans_.buf_offset = offset - 1;
  430|     27|      ans_.state = buf[offset - 1] & 0x3F;
  431|     56|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 17, False: 39]
  ------------------
  432|     17|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 6, False: 11]
  ------------------
  433|      6|        return 1;
  434|      6|      }
  435|     11|      ans_.buf_offset = offset - 2;
  436|     11|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     39|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 20, False: 19]
  ------------------
  438|     20|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 17]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     17|      ans_.buf_offset = offset - 3;
  442|     17|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     19|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 19, False: 0]
  ------------------
  444|     19|      ans_.buf_offset = offset - 4;
  445|     19|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     19|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     74|    ans_.state += l_rans_base;
  450|     74|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     74|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 16, False: 58]
  ------------------
  451|     16|      return 1;
  452|     16|    }
  453|     58|    return 0;
  454|     74|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   404k|  inline int rans_read() {
  463|   404k|    unsigned rem;
  464|   404k|    unsigned quo;
  465|   404k|    struct rans_dec_sym sym;
  466|   406k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 394k, False: 12.0k]
  |  Branch (466:40): [True: 1.82k, False: 392k]
  ------------------
  467|  1.82k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.82k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.82k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   404k|    quo = ans_.state / rans_precision;
  472|   404k|    rem = ans_.state % rans_precision;
  473|   404k|    fetch_sym(&sym, rem);
  474|   404k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   404k|    return sym.val;
  476|   404k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   404k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   404k|    uint32_t symbol = lut_table_[rem];
  507|   404k|    out->val = symbol;
  508|   404k|    out->prob = probability_table_[symbol].prob;
  509|   404k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   404k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     58|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    361|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    221|                                       uint32_t num_symbols) {
  482|    221|    lut_table_.resize(rans_precision);
  483|    221|    probability_table_.resize(num_symbols);
  484|    221|    uint32_t cum_prob = 0;
  485|    221|    uint32_t act_prob = 0;
  486|  9.74k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 9.56k, False: 186]
  ------------------
  487|  9.56k|      probability_table_[i].prob = token_probs[i];
  488|  9.56k|      probability_table_[i].cum_prob = cum_prob;
  489|  9.56k|      cum_prob += token_probs[i];
  490|  9.56k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 35, False: 9.52k]
  ------------------
  491|     35|        return false;
  492|     35|      }
  493|  11.0M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 11.0M, False: 9.52k]
  ------------------
  494|  11.0M|        lut_table_[j] = i;
  495|  11.0M|      }
  496|  9.52k|      act_prob = cum_prob;
  497|  9.52k|    }
  498|    186|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 47, False: 139]
  ------------------
  499|     47|      return false;
  500|     47|    }
  501|    139|    return true;
  502|    186|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     67|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     67|    unsigned x;
  423|     67|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 66]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     66|    ans_.buf = buf;
  427|     66|    x = buf[offset - 1] >> 6;
  428|     66|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 20, False: 46]
  ------------------
  429|     20|      ans_.buf_offset = offset - 1;
  430|     20|      ans_.state = buf[offset - 1] & 0x3F;
  431|     46|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 20, False: 26]
  ------------------
  432|     20|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 10]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     26|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 19, False: 7]
  ------------------
  438|     19|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 15, False: 4]
  ------------------
  439|     15|        return 1;
  440|     15|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      7|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 7, False: 0]
  ------------------
  444|      7|      ans_.buf_offset = offset - 4;
  445|      7|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      7|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     41|    ans_.state += l_rans_base;
  450|     41|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     41|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 7, False: 34]
  ------------------
  451|      7|      return 1;
  452|      7|    }
  453|     34|    return 0;
  454|     41|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|  41.8k|  inline int rans_read() {
  463|  41.8k|    unsigned rem;
  464|  41.8k|    unsigned quo;
  465|  41.8k|    struct rans_dec_sym sym;
  466|  42.3k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 39.8k, False: 2.42k]
  |  Branch (466:40): [True: 446, False: 39.4k]
  ------------------
  467|    446|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    446|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    446|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  41.8k|    quo = ans_.state / rans_precision;
  472|  41.8k|    rem = ans_.state % rans_precision;
  473|  41.8k|    fetch_sym(&sym, rem);
  474|  41.8k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  41.8k|    return sym.val;
  476|  41.8k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|  41.8k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  41.8k|    uint32_t symbol = lut_table_[rem];
  507|  41.8k|    out->val = symbol;
  508|  41.8k|    out->prob = probability_table_[symbol].prob;
  509|  41.8k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  41.8k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     34|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    371|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    230|                                       uint32_t num_symbols) {
  482|    230|    lut_table_.resize(rans_precision);
  483|    230|    probability_table_.resize(num_symbols);
  484|    230|    uint32_t cum_prob = 0;
  485|    230|    uint32_t act_prob = 0;
  486|  4.44k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.23k, False: 204]
  ------------------
  487|  4.23k|      probability_table_[i].prob = token_probs[i];
  488|  4.23k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.23k|      cum_prob += token_probs[i];
  490|  4.23k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 26, False: 4.21k]
  ------------------
  491|     26|        return false;
  492|     26|      }
  493|  42.4M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 42.4M, False: 4.21k]
  ------------------
  494|  42.4M|        lut_table_[j] = i;
  495|  42.4M|      }
  496|  4.21k|      act_prob = cum_prob;
  497|  4.21k|    }
  498|    204|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 57, False: 147]
  ------------------
  499|     57|      return false;
  500|     57|    }
  501|    147|    return true;
  502|    204|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     71|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     71|    unsigned x;
  423|     71|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 65]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     65|    ans_.buf = buf;
  427|     65|    x = buf[offset - 1] >> 6;
  428|     65|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 19, False: 46]
  ------------------
  429|     19|      ans_.buf_offset = offset - 1;
  430|     19|      ans_.state = buf[offset - 1] & 0x3F;
  431|     46|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 5, False: 41]
  ------------------
  432|      5|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 4]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      4|      ans_.buf_offset = offset - 2;
  436|      4|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     41|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 20, False: 21]
  ------------------
  438|     20|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 17]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     17|      ans_.buf_offset = offset - 3;
  442|     17|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     21|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 21, False: 0]
  ------------------
  444|     21|      ans_.buf_offset = offset - 4;
  445|     21|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     21|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     61|    ans_.state += l_rans_base;
  450|     61|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     61|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 51]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     51|    return 0;
  454|     61|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|   167k|  inline int rans_read() {
  463|   167k|    unsigned rem;
  464|   167k|    unsigned quo;
  465|   167k|    struct rans_dec_sym sym;
  466|   168k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 93.7k, False: 74.4k]
  |  Branch (466:40): [True: 293, False: 93.4k]
  ------------------
  467|    293|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    293|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    293|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   167k|    quo = ans_.state / rans_precision;
  472|   167k|    rem = ans_.state % rans_precision;
  473|   167k|    fetch_sym(&sym, rem);
  474|   167k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   167k|    return sym.val;
  476|   167k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|   167k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   167k|    uint32_t symbol = lut_table_[rem];
  507|   167k|    out->val = symbol;
  508|   167k|    out->prob = probability_table_[symbol].prob;
  509|   167k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   167k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     51|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    309|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    185|                                       uint32_t num_symbols) {
  482|    185|    lut_table_.resize(rans_precision);
  483|    185|    probability_table_.resize(num_symbols);
  484|    185|    uint32_t cum_prob = 0;
  485|    185|    uint32_t act_prob = 0;
  486|  4.06k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.89k, False: 164]
  ------------------
  487|  3.89k|      probability_table_[i].prob = token_probs[i];
  488|  3.89k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.89k|      cum_prob += token_probs[i];
  490|  3.89k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 21, False: 3.87k]
  ------------------
  491|     21|        return false;
  492|     21|      }
  493|  68.4M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 68.4M, False: 3.87k]
  ------------------
  494|  68.4M|        lut_table_[j] = i;
  495|  68.4M|      }
  496|  3.87k|      act_prob = cum_prob;
  497|  3.87k|    }
  498|    164|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 45, False: 119]
  ------------------
  499|     45|      return false;
  500|     45|    }
  501|    119|    return true;
  502|    164|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     75|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     75|    unsigned x;
  423|     75|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 69]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     69|    ans_.buf = buf;
  427|     69|    x = buf[offset - 1] >> 6;
  428|     69|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 17, False: 52]
  ------------------
  429|     17|      ans_.buf_offset = offset - 1;
  430|     17|      ans_.state = buf[offset - 1] & 0x3F;
  431|     52|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 4, False: 48]
  ------------------
  432|      4|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 3]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     48|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 36]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 11]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|     11|      ans_.buf_offset = offset - 3;
  442|     11|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     36|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 36, False: 0]
  ------------------
  444|     36|      ans_.buf_offset = offset - 4;
  445|     36|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     36|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     67|    ans_.state += l_rans_base;
  450|     67|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     67|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 18, False: 49]
  ------------------
  451|     18|      return 1;
  452|     18|    }
  453|     49|    return 0;
  454|     67|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   362k|  inline int rans_read() {
  463|   362k|    unsigned rem;
  464|   362k|    unsigned quo;
  465|   362k|    struct rans_dec_sym sym;
  466|   363k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 259k, False: 104k]
  |  Branch (466:40): [True: 1.22k, False: 258k]
  ------------------
  467|  1.22k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.22k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.22k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   362k|    quo = ans_.state / rans_precision;
  472|   362k|    rem = ans_.state % rans_precision;
  473|   362k|    fetch_sym(&sym, rem);
  474|   362k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   362k|    return sym.val;
  476|   362k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   362k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   362k|    uint32_t symbol = lut_table_[rem];
  507|   362k|    out->val = symbol;
  508|   362k|    out->prob = probability_table_[symbol].prob;
  509|   362k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   362k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     49|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.60k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    902|                                       uint32_t num_symbols) {
  482|    902|    lut_table_.resize(rans_precision);
  483|    902|    probability_table_.resize(num_symbols);
  484|    902|    uint32_t cum_prob = 0;
  485|    902|    uint32_t act_prob = 0;
  486|  10.1k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 9.33k, False: 856]
  ------------------
  487|  9.33k|      probability_table_[i].prob = token_probs[i];
  488|  9.33k|      probability_table_[i].cum_prob = cum_prob;
  489|  9.33k|      cum_prob += token_probs[i];
  490|  9.33k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 46, False: 9.29k]
  ------------------
  491|     46|        return false;
  492|     46|      }
  493|   823M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 823M, False: 9.29k]
  ------------------
  494|   823M|        lut_table_[j] = i;
  495|   823M|      }
  496|  9.29k|      act_prob = cum_prob;
  497|  9.29k|    }
  498|    856|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 98, False: 758]
  ------------------
  499|     98|      return false;
  500|     98|    }
  501|    758|    return true;
  502|    856|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    447|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    447|    unsigned x;
  423|    447|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 27, False: 420]
  ------------------
  424|     27|      return 1;
  425|     27|    }
  426|    420|    ans_.buf = buf;
  427|    420|    x = buf[offset - 1] >> 6;
  428|    420|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 107, False: 313]
  ------------------
  429|    107|      ans_.buf_offset = offset - 1;
  430|    107|      ans_.state = buf[offset - 1] & 0x3F;
  431|    313|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 95, False: 218]
  ------------------
  432|     95|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 33, False: 62]
  ------------------
  433|     33|        return 1;
  434|     33|      }
  435|     62|      ans_.buf_offset = offset - 2;
  436|     62|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    218|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 76, False: 142]
  ------------------
  438|     76|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 18, False: 58]
  ------------------
  439|     18|        return 1;
  440|     18|      }
  441|     58|      ans_.buf_offset = offset - 3;
  442|     58|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    142|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 142, False: 0]
  ------------------
  444|    142|      ans_.buf_offset = offset - 4;
  445|    142|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    142|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    369|    ans_.state += l_rans_base;
  450|    369|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    369|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 37, False: 332]
  ------------------
  451|     37|      return 1;
  452|     37|    }
  453|    332|    return 0;
  454|    369|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  92.0M|  inline int rans_read() {
  463|  92.0M|    unsigned rem;
  464|  92.0M|    unsigned quo;
  465|  92.0M|    struct rans_dec_sym sym;
  466|  92.0M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 81.2M, False: 10.8M]
  |  Branch (466:40): [True: 4.29k, False: 81.2M]
  ------------------
  467|  4.29k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.29k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.29k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  92.0M|    quo = ans_.state / rans_precision;
  472|  92.0M|    rem = ans_.state % rans_precision;
  473|  92.0M|    fetch_sym(&sym, rem);
  474|  92.0M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  92.0M|    return sym.val;
  476|  92.0M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  92.0M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  92.0M|    uint32_t symbol = lut_table_[rem];
  507|  92.0M|    out->val = symbol;
  508|  92.0M|    out->prob = probability_table_[symbol].prob;
  509|  92.0M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  92.0M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    332|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.23k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.23k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.23k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.23k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.23k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.23k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.23k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 61, False: 1.17k]
  ------------------
   67|     61|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 8, False: 53]
  ------------------
   68|      8|      return false;
   69|      8|    }
   70|       |
   71|     61|  } else
   72|  1.17k|#endif
   73|  1.17k|  {
   74|  1.17k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 33, False: 1.14k]
  ------------------
   75|     33|      return false;
   76|     33|    }
   77|  1.17k|  }
   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.19k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 60, False: 1.13k]
  ------------------
   83|     60|    return false;
   84|     60|  }
   85|  1.13k|  probability_table_.resize(num_symbols_);
   86|  1.13k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 445, False: 690]
  ------------------
   87|    445|    return true;
   88|    445|  }
   89|       |  // Decode the table.
   90|  54.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 54.0k, False: 505]
  ------------------
   91|  54.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  54.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 74, False: 53.9k]
  ------------------
   95|     74|      return false;
   96|     74|    }
   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|  53.9k|    const int token = prob_data & 3;
  102|  53.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 21.1k, False: 32.7k]
  ------------------
  103|  21.1k|      const uint32_t offset = prob_data >> 2;
  104|  21.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 84, False: 21.1k]
  ------------------
  105|     84|        return false;
  106|     84|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   683k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 662k, False: 21.1k]
  ------------------
  109|   662k|        probability_table_[i + j] = 0;
  110|   662k|      }
  111|  21.1k|      i += offset;
  112|  32.7k|    } else {
  113|  32.7k|      const int extra_bytes = token;
  114|  32.7k|      uint32_t prob = prob_data >> 2;
  115|  59.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 26.6k, False: 32.7k]
  ------------------
  116|  26.6k|        uint8_t eb;
  117|  26.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 26.5k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  26.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  26.5k|      }
  124|  32.7k|      probability_table_[i] = prob;
  125|  32.7k|    }
  126|  53.9k|  }
  127|    505|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 146, False: 359]
  ------------------
  128|    146|    return false;
  129|    146|  }
  130|    359|  return true;
  131|    505|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    687|    DecoderBuffer *buffer) {
  136|    687|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    687|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    687|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    687|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 33, False: 654]
  ------------------
  140|     33|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 7, False: 26]
  ------------------
  141|      7|      return false;
  142|      7|    }
  143|       |
  144|     33|  } else
  145|    654|#endif
  146|    654|  {
  147|    654|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 41, False: 613]
  ------------------
  148|     41|      return false;
  149|     41|    }
  150|    654|  }
  151|    639|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 122, False: 517]
  ------------------
  152|    122|    return false;
  153|    122|  }
  154|    517|  const uint8_t *const data_head =
  155|    517|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    517|  buffer->Advance(bytes_encoded);
  158|    517|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 131, False: 386]
  ------------------
  159|    131|    return false;
  160|    131|  }
  161|    386|  return true;
  162|    517|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    524|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  1.54M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    321|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    321|  ans_.read_end();
  167|    321|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    525|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    525|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    525|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 525]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    525|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    525|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    525|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 53, False: 472]
  ------------------
   67|     53|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 49]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     53|  } else
   72|    472|#endif
   73|    472|  {
   74|    472|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 463]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    472|  }
   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|    512|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 41, False: 471]
  ------------------
   83|     41|    return false;
   84|     41|  }
   85|    471|  probability_table_.resize(num_symbols_);
   86|    471|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 16, False: 455]
  ------------------
   87|     16|    return true;
   88|     16|  }
   89|       |  // Decode the table.
   90|   930k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 930k, False: 316]
  ------------------
   91|   930k|    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|   930k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 55, False: 930k]
  ------------------
   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|   930k|    const int token = prob_data & 3;
  102|   930k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 244k, False: 685k]
  ------------------
  103|   244k|      const uint32_t offset = prob_data >> 2;
  104|   244k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 55, False: 244k]
  ------------------
  105|     55|        return false;
  106|     55|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.58M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.34M, False: 244k]
  ------------------
  109|  7.34M|        probability_table_[i + j] = 0;
  110|  7.34M|      }
  111|   244k|      i += offset;
  112|   685k|    } else {
  113|   685k|      const int extra_bytes = token;
  114|   685k|      uint32_t prob = prob_data >> 2;
  115|   706k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 20.8k, False: 685k]
  ------------------
  116|  20.8k|        uint8_t eb;
  117|  20.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 20.8k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  20.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  20.8k|      }
  124|   685k|      probability_table_[i] = prob;
  125|   685k|    }
  126|   930k|  }
  127|    316|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 108, False: 208]
  ------------------
  128|    108|    return false;
  129|    108|  }
  130|    208|  return true;
  131|    316|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    224|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    208|    DecoderBuffer *buffer) {
  136|    208|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    208|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    208|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    208|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 8, False: 200]
  ------------------
  140|      8|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 7]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      8|  } else
  145|    200|#endif
  146|    200|  {
  147|    200|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 198]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    200|  }
  151|    205|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 44, False: 161]
  ------------------
  152|     44|    return false;
  153|     44|  }
  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: 19, False: 142]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|    142|  return true;
  162|    161|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  38.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    142|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    142|  ans_.read_end();
  167|    142|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    533|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    533|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    533|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 533]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    533|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    533|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    533|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 50, False: 483]
  ------------------
   67|     50|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 48]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     50|  } else
   72|    483|#endif
   73|    483|  {
   74|    483|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 475]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    483|  }
   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|    523|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 32, False: 491]
  ------------------
   83|     32|    return false;
   84|     32|  }
   85|    491|  probability_table_.resize(num_symbols_);
   86|    491|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 477]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|   627k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 627k, False: 345]
  ------------------
   91|   627k|    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|   627k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 59, False: 627k]
  ------------------
   95|     59|      return false;
   96|     59|    }
   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|   627k|    const int token = prob_data & 3;
  102|   627k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 344k, False: 282k]
  ------------------
  103|   344k|      const uint32_t offset = prob_data >> 2;
  104|   344k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 40, False: 344k]
  ------------------
  105|     40|        return false;
  106|     40|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  11.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 11.1M, False: 344k]
  ------------------
  109|  11.1M|        probability_table_[i + j] = 0;
  110|  11.1M|      }
  111|   344k|      i += offset;
  112|   344k|    } else {
  113|   282k|      const int extra_bytes = token;
  114|   282k|      uint32_t prob = prob_data >> 2;
  115|   412k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 129k, False: 282k]
  ------------------
  116|   129k|        uint8_t eb;
  117|   129k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 33, False: 129k]
  ------------------
  118|     33|          return false;
  119|     33|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   129k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   129k|      }
  124|   282k|      probability_table_[i] = prob;
  125|   282k|    }
  126|   627k|  }
  127|    345|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 30, False: 315]
  ------------------
  128|     30|    return false;
  129|     30|  }
  130|    315|  return true;
  131|    345|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    329|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    315|    DecoderBuffer *buffer) {
  136|    315|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    315|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    315|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    315|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 288]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 25]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     27|  } else
  145|    288|#endif
  146|    288|  {
  147|    288|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 282]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    288|  }
  151|    307|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 86, False: 221]
  ------------------
  152|     86|    return false;
  153|     86|  }
  154|    221|  const uint8_t *const data_head =
  155|    221|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    221|  buffer->Advance(bytes_encoded);
  158|    221|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 199]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|    199|  return true;
  162|    221|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  6.05M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    199|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    199|  ans_.read_end();
  167|    199|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    355|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    355|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    355|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 355]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    355|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    355|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    355|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 52, False: 303]
  ------------------
   67|     52|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 51]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     52|  } else
   72|    303|#endif
   73|    303|  {
   74|    303|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 301]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    303|  }
   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|    352|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 335]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    335|  probability_table_.resize(num_symbols_);
   86|    335|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 328]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  15.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 15.2k, False: 231]
  ------------------
   91|  15.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|  15.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 55, False: 15.1k]
  ------------------
   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|  15.1k|    const int token = prob_data & 3;
  102|  15.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.15k, False: 10.0k]
  ------------------
  103|  5.15k|      const uint32_t offset = prob_data >> 2;
  104|  5.15k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 5.13k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   161k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 156k, False: 5.13k]
  ------------------
  109|   156k|        probability_table_[i + j] = 0;
  110|   156k|      }
  111|  5.13k|      i += offset;
  112|  10.0k|    } else {
  113|  10.0k|      const int extra_bytes = token;
  114|  10.0k|      uint32_t prob = prob_data >> 2;
  115|  16.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.51k, False: 9.99k]
  ------------------
  116|  6.51k|        uint8_t eb;
  117|  6.51k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 6.49k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.49k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.49k|      }
  124|  9.99k|      probability_table_[i] = prob;
  125|  9.99k|    }
  126|  15.1k|  }
  127|    231|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 29, False: 202]
  ------------------
  128|     29|    return false;
  129|     29|  }
  130|    202|  return true;
  131|    231|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    209|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    202|    DecoderBuffer *buffer) {
  136|    202|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    202|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    202|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    202|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 48, False: 154]
  ------------------
  140|     48|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 44]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     48|  } else
  145|    154|#endif
  146|    154|  {
  147|    154|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 152]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    154|  }
  151|    196|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 90, False: 106]
  ------------------
  152|     90|    return false;
  153|     90|  }
  154|    106|  const uint8_t *const data_head =
  155|    106|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    106|  buffer->Advance(bytes_encoded);
  158|    106|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 17, False: 89]
  ------------------
  159|     17|    return false;
  160|     17|  }
  161|     89|  return true;
  162|    106|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  7.16M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|     89|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     89|  ans_.read_end();
  167|     89|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    279|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    279|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    279|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 279]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    279|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    279|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    279|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 250]
  ------------------
   67|     29|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 27]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     29|  } else
   72|    250|#endif
   73|    250|  {
   74|    250|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 239]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    250|  }
   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|    266|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 255]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    255|  probability_table_.resize(num_symbols_);
   86|    255|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 246]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  39.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 39.8k, False: 144]
  ------------------
   91|  39.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|  39.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 48, False: 39.7k]
  ------------------
   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|  39.7k|    const int token = prob_data & 3;
  102|  39.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 11.1k, False: 28.6k]
  ------------------
  103|  11.1k|      const uint32_t offset = prob_data >> 2;
  104|  11.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 11.0k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   397k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 386k, False: 11.0k]
  ------------------
  109|   386k|        probability_table_[i + j] = 0;
  110|   386k|      }
  111|  11.0k|      i += offset;
  112|  28.6k|    } else {
  113|  28.6k|      const int extra_bytes = token;
  114|  28.6k|      uint32_t prob = prob_data >> 2;
  115|  45.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 16.5k, False: 28.6k]
  ------------------
  116|  16.5k|        uint8_t eb;
  117|  16.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 16.5k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  16.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  16.5k|      }
  124|  28.6k|      probability_table_[i] = prob;
  125|  28.6k|    }
  126|  39.7k|  }
  127|    144|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 22, False: 122]
  ------------------
  128|     22|    return false;
  129|     22|  }
  130|    122|  return true;
  131|    144|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    131|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    122|    DecoderBuffer *buffer) {
  136|    122|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    122|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    122|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    122|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 106]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 13]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     16|  } else
  145|    106|#endif
  146|    106|  {
  147|    106|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 103]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    106|  }
  151|    116|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 18, False: 98]
  ------------------
  152|     18|    return false;
  153|     18|  }
  154|     98|  const uint8_t *const data_head =
  155|     98|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     98|  buffer->Advance(bytes_encoded);
  158|     98|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 85]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|     85|  return true;
  162|     98|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  1.11M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     85|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     85|  ans_.read_end();
  167|     85|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    367|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    367|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    367|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 367]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    367|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    367|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    367|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 58, False: 309]
  ------------------
   67|     58|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 57]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     58|  } else
   72|    309|#endif
   73|    309|  {
   74|    309|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 303]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    309|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    360|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 25, False: 335]
  ------------------
   83|     25|    return false;
   84|     25|  }
   85|    335|  probability_table_.resize(num_symbols_);
   86|    335|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 328]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  55.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 55.5k, False: 238]
  ------------------
   91|  55.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|  55.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 48, False: 55.5k]
  ------------------
   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|  55.5k|    const int token = prob_data & 3;
  102|  55.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 18.6k, False: 36.8k]
  ------------------
  103|  18.6k|      const uint32_t offset = prob_data >> 2;
  104|  18.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 18.6k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   500k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 481k, False: 18.6k]
  ------------------
  109|   481k|        probability_table_[i + j] = 0;
  110|   481k|      }
  111|  18.6k|      i += offset;
  112|  36.8k|    } else {
  113|  36.8k|      const int extra_bytes = token;
  114|  36.8k|      uint32_t prob = prob_data >> 2;
  115|  66.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 29.7k, False: 36.8k]
  ------------------
  116|  29.7k|        uint8_t eb;
  117|  29.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 29.7k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  29.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  29.7k|      }
  124|  36.8k|      probability_table_[i] = prob;
  125|  36.8k|    }
  126|  55.5k|  }
  127|    238|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 25, False: 213]
  ------------------
  128|     25|    return false;
  129|     25|  }
  130|    213|  return true;
  131|    238|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    220|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    213|    DecoderBuffer *buffer) {
  136|    213|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    213|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    213|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    213|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 35, False: 178]
  ------------------
  140|     35|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 33]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     35|  } else
  145|    178|#endif
  146|    178|  {
  147|    178|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 177]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    178|  }
  151|    210|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 72, False: 138]
  ------------------
  152|     72|    return false;
  153|     72|  }
  154|    138|  const uint8_t *const data_head =
  155|    138|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    138|  buffer->Advance(bytes_encoded);
  158|    138|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 28, False: 110]
  ------------------
  159|     28|    return false;
  160|     28|  }
  161|    110|  return true;
  162|    138|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  12.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    110|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    110|  ans_.read_end();
  167|    110|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    382|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    382|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    382|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 382]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    382|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    382|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    382|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 50, False: 332]
  ------------------
   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|    332|#endif
   73|    332|  {
   74|    332|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 325]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    332|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    372|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 353]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    353|  probability_table_.resize(num_symbols_);
   86|    353|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 15, False: 338]
  ------------------
   87|     15|    return true;
   88|     15|  }
   89|       |  // Decode the table.
   90|   682k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 682k, False: 201]
  ------------------
   91|   682k|    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|   682k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 73, False: 682k]
  ------------------
   95|     73|      return false;
   96|     73|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   682k|    const int token = prob_data & 3;
  102|   682k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 229k, False: 452k]
  ------------------
  103|   229k|      const uint32_t offset = prob_data >> 2;
  104|   229k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 38, False: 229k]
  ------------------
  105|     38|        return false;
  106|     38|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.68M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.45M, False: 229k]
  ------------------
  109|  8.45M|        probability_table_[i + j] = 0;
  110|  8.45M|      }
  111|   229k|      i += offset;
  112|   452k|    } else {
  113|   452k|      const int extra_bytes = token;
  114|   452k|      uint32_t prob = prob_data >> 2;
  115|   745k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 293k, False: 452k]
  ------------------
  116|   293k|        uint8_t eb;
  117|   293k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 293k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   293k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   293k|      }
  124|   452k|      probability_table_[i] = prob;
  125|   452k|    }
  126|   682k|  }
  127|    201|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 24, False: 177]
  ------------------
  128|     24|    return false;
  129|     24|  }
  130|    177|  return true;
  131|    201|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    192|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    177|    DecoderBuffer *buffer) {
  136|    177|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    177|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    177|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    177|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 24, False: 153]
  ------------------
  140|     24|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 19]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     24|  } else
  145|    153|#endif
  146|    153|  {
  147|    153|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 152]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    153|  }
  151|    171|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 49, False: 122]
  ------------------
  152|     49|    return false;
  153|     49|  }
  154|    122|  const uint8_t *const data_head =
  155|    122|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    122|  buffer->Advance(bytes_encoded);
  158|    122|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 37, False: 85]
  ------------------
  159|     37|    return false;
  160|     37|  }
  161|     85|  return true;
  162|    122|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  7.92M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     85|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     85|  ans_.read_end();
  167|     85|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    403|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    403|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    403|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 403]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    403|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    403|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    403|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 69, False: 334]
  ------------------
   67|     69|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 65]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     69|  } else
   72|    334|#endif
   73|    334|  {
   74|    334|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 22, False: 312]
  ------------------
   75|     22|      return false;
   76|     22|    }
   77|    334|  }
   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|    377|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 35, False: 342]
  ------------------
   83|     35|    return false;
   84|     35|  }
   85|    342|  probability_table_.resize(num_symbols_);
   86|    342|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 338]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|   471k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 471k, False: 234]
  ------------------
   91|   471k|    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|   471k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 48, False: 471k]
  ------------------
   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|   471k|    const int token = prob_data & 3;
  102|   471k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 136k, False: 334k]
  ------------------
  103|   136k|      const uint32_t offset = prob_data >> 2;
  104|   136k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 136k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.95M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.82M, False: 136k]
  ------------------
  109|  4.82M|        probability_table_[i + j] = 0;
  110|  4.82M|      }
  111|   136k|      i += offset;
  112|   334k|    } else {
  113|   334k|      const int extra_bytes = token;
  114|   334k|      uint32_t prob = prob_data >> 2;
  115|   583k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 249k, False: 334k]
  ------------------
  116|   249k|        uint8_t eb;
  117|   249k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 249k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   249k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   249k|      }
  124|   334k|      probability_table_[i] = prob;
  125|   334k|    }
  126|   471k|  }
  127|    234|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 29, False: 205]
  ------------------
  128|     29|    return false;
  129|     29|  }
  130|    205|  return true;
  131|    234|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    209|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    205|    DecoderBuffer *buffer) {
  136|    205|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    205|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    205|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    205|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 42, False: 163]
  ------------------
  140|     42|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 41]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     42|  } else
  145|    163|#endif
  146|    163|  {
  147|    163|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 162]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    163|  }
  151|    203|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 101, False: 102]
  ------------------
  152|    101|    return false;
  153|    101|  }
  154|    102|  const uint8_t *const data_head =
  155|    102|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    102|  buffer->Advance(bytes_encoded);
  158|    102|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 67]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|     67|  return true;
  162|    102|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  2.11M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     67|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     67|  ans_.read_end();
  167|     67|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    309|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_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: 16, False: 293]
  ------------------
   67|     16|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 15]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     16|  } else
   72|    293|#endif
   73|    293|  {
   74|    293|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 289]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    293|  }
   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|    304|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 280]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    280|  probability_table_.resize(num_symbols_);
   86|    280|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 270]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  30.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 30.2k, False: 179]
  ------------------
   91|  30.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|  30.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 30.2k]
  ------------------
   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|  30.2k|    const int token = prob_data & 3;
  102|  30.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.13k, False: 24.0k]
  ------------------
  103|  6.13k|      const uint32_t offset = prob_data >> 2;
  104|  6.13k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 6.09k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   221k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 215k, False: 6.09k]
  ------------------
  109|   215k|        probability_table_[i + j] = 0;
  110|   215k|      }
  111|  6.09k|      i += offset;
  112|  24.0k|    } else {
  113|  24.0k|      const int extra_bytes = token;
  114|  24.0k|      uint32_t prob = prob_data >> 2;
  115|  32.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.88k, False: 24.0k]
  ------------------
  116|  8.88k|        uint8_t eb;
  117|  8.88k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 8.86k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.86k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.86k|      }
  124|  24.0k|      probability_table_[i] = prob;
  125|  24.0k|    }
  126|  30.2k|  }
  127|    179|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 62, False: 117]
  ------------------
  128|     62|    return false;
  129|     62|  }
  130|    117|  return true;
  131|    179|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    127|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    117|    DecoderBuffer *buffer) {
  136|    117|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    117|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    117|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    117|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 117]
  ------------------
  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|    117|#endif
  146|    117|  {
  147|    117|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 116]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    117|  }
  151|    116|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 56, False: 60]
  ------------------
  152|     56|    return false;
  153|     56|  }
  154|     60|  const uint8_t *const data_head =
  155|     60|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     60|  buffer->Advance(bytes_encoded);
  158|     60|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 17, False: 43]
  ------------------
  159|     17|    return false;
  160|     17|  }
  161|     43|  return true;
  162|     60|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   133k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     43|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     43|  ans_.read_end();
  167|     43|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    315|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    315|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    315|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 315]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    315|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    315|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    315|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 14, False: 301]
  ------------------
   67|     14|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 13]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     14|  } else
   72|    301|#endif
   73|    301|  {
   74|    301|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 298]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    301|  }
   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: 16, False: 295]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    295|  probability_table_.resize(num_symbols_);
   86|    295|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 290]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   145k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 145k, False: 176]
  ------------------
   91|   145k|    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|   145k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 52, False: 145k]
  ------------------
   95|     52|      return false;
   96|     52|    }
   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|   145k|    const int token = prob_data & 3;
  102|   145k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 52.3k, False: 92.6k]
  ------------------
  103|  52.3k|      const uint32_t offset = prob_data >> 2;
  104|  52.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 41, False: 52.3k]
  ------------------
  105|     41|        return false;
  106|     41|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.83M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.78M, False: 52.3k]
  ------------------
  109|  1.78M|        probability_table_[i + j] = 0;
  110|  1.78M|      }
  111|  52.3k|      i += offset;
  112|  92.6k|    } else {
  113|  92.6k|      const int extra_bytes = token;
  114|  92.6k|      uint32_t prob = prob_data >> 2;
  115|   165k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 72.7k, False: 92.6k]
  ------------------
  116|  72.7k|        uint8_t eb;
  117|  72.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 72.7k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  72.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  72.7k|      }
  124|  92.6k|      probability_table_[i] = prob;
  125|  92.6k|    }
  126|   145k|  }
  127|    176|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 53, False: 123]
  ------------------
  128|     53|    return false;
  129|     53|  }
  130|    123|  return true;
  131|    176|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    128|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    123|    DecoderBuffer *buffer) {
  136|    123|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    123|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    123|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    123|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 123]
  ------------------
  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|    123|#endif
  146|    123|  {
  147|    123|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 122]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    123|  }
  151|    122|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 38, False: 84]
  ------------------
  152|     38|    return false;
  153|     38|  }
  154|     84|  const uint8_t *const data_head =
  155|     84|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     84|  buffer->Advance(bytes_encoded);
  158|     84|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 58]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     58|  return true;
  162|     84|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   404k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    361|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    361|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    361|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 361]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    361|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    361|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    361|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 331]
  ------------------
   67|     30|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 29]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     30|  } else
   72|    331|#endif
   73|    331|  {
   74|    331|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 329]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    331|  }
   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|    358|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 337]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    337|  probability_table_.resize(num_symbols_);
   86|    337|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 331]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  59.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 59.1k, False: 221]
  ------------------
   91|  59.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  59.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 45, False: 59.1k]
  ------------------
   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|  59.1k|    const int token = prob_data & 3;
  102|  59.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 20.5k, False: 38.6k]
  ------------------
  103|  20.5k|      const uint32_t offset = prob_data >> 2;
  104|  20.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 45, False: 20.5k]
  ------------------
  105|     45|        return false;
  106|     45|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   821k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 801k, False: 20.5k]
  ------------------
  109|   801k|        probability_table_[i + j] = 0;
  110|   801k|      }
  111|  20.5k|      i += offset;
  112|  38.6k|    } else {
  113|  38.6k|      const int extra_bytes = token;
  114|  38.6k|      uint32_t prob = prob_data >> 2;
  115|  57.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 18.8k, False: 38.5k]
  ------------------
  116|  18.8k|        uint8_t eb;
  117|  18.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 18.8k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  18.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  18.8k|      }
  124|  38.5k|      probability_table_[i] = prob;
  125|  38.5k|    }
  126|  59.1k|  }
  127|    221|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 82, False: 139]
  ------------------
  128|     82|    return false;
  129|     82|  }
  130|    139|  return true;
  131|    221|}
_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: 4, False: 135]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    139|  }
  151|    135|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 68, False: 67]
  ------------------
  152|     68|    return false;
  153|     68|  }
  154|     67|  const uint8_t *const data_head =
  155|     67|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     67|  buffer->Advance(bytes_encoded);
  158|     67|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 34]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     34|  return true;
  162|     67|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  41.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     34|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     34|  ans_.read_end();
  167|     34|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    371|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    371|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    371|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 371]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    371|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    371|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    371|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 369]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 1]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|      2|  } else
   72|    369|#endif
   73|    369|  {
   74|    369|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 359]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    369|  }
   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|    360|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 351]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    351|  probability_table_.resize(num_symbols_);
   86|    351|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 342]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  65.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 65.2k, False: 230]
  ------------------
   91|  65.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|  65.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 63, False: 65.2k]
  ------------------
   95|     63|      return false;
   96|     63|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  65.2k|    const int token = prob_data & 3;
  102|  65.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.4k, False: 54.7k]
  ------------------
  103|  10.4k|      const uint32_t offset = prob_data >> 2;
  104|  10.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 10.4k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   348k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 337k, False: 10.4k]
  ------------------
  109|   337k|        probability_table_[i + j] = 0;
  110|   337k|      }
  111|  10.4k|      i += offset;
  112|  54.7k|    } else {
  113|  54.7k|      const int extra_bytes = token;
  114|  54.7k|      uint32_t prob = prob_data >> 2;
  115|  66.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 11.4k, False: 54.7k]
  ------------------
  116|  11.4k|        uint8_t eb;
  117|  11.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 11.4k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  11.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  11.4k|      }
  124|  54.7k|      probability_table_[i] = prob;
  125|  54.7k|    }
  126|  65.2k|  }
  127|    230|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 83, False: 147]
  ------------------
  128|     83|    return false;
  129|     83|  }
  130|    147|  return true;
  131|    230|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    156|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    147|    DecoderBuffer *buffer) {
  136|    147|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    147|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    147|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    147|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 147]
  ------------------
  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|    147|#endif
  146|    147|  {
  147|    147|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 144]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    147|  }
  151|    144|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 73, False: 71]
  ------------------
  152|     73|    return false;
  153|     73|  }
  154|     71|  const uint8_t *const data_head =
  155|     71|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     71|  buffer->Advance(bytes_encoded);
  158|     71|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 20, False: 51]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|     51|  return true;
  162|     71|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   167k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     51|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     51|  ans_.read_end();
  167|     51|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    309|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_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: 15, False: 294]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 13]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     15|  } else
   72|    294|#endif
   73|    294|  {
   74|    294|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 292]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    294|  }
   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|    305|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 293]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    293|  probability_table_.resize(num_symbols_);
   86|    293|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 280]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|   247k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 247k, False: 185]
  ------------------
   91|   247k|    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|   247k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 247k]
  ------------------
   95|     47|      return false;
   96|     47|    }
   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|   247k|    const int token = prob_data & 3;
  102|   247k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 70.1k, False: 177k]
  ------------------
  103|  70.1k|      const uint32_t offset = prob_data >> 2;
  104|  70.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 70.0k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.55M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.48M, False: 70.0k]
  ------------------
  109|  2.48M|        probability_table_[i + j] = 0;
  110|  2.48M|      }
  111|  70.0k|      i += offset;
  112|   177k|    } else {
  113|   177k|      const int extra_bytes = token;
  114|   177k|      uint32_t prob = prob_data >> 2;
  115|   308k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 131k, False: 177k]
  ------------------
  116|   131k|        uint8_t eb;
  117|   131k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 131k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   131k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   131k|      }
  124|   177k|      probability_table_[i] = prob;
  125|   177k|    }
  126|   247k|  }
  127|    185|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 66, False: 119]
  ------------------
  128|     66|    return false;
  129|     66|  }
  130|    119|  return true;
  131|    185|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    132|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    119|    DecoderBuffer *buffer) {
  136|    119|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    119|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    119|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    119|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 119]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|    119|#endif
  146|    119|  {
  147|    119|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 113]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    119|  }
  151|    113|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 38, False: 75]
  ------------------
  152|     38|    return false;
  153|     38|  }
  154|     75|  const uint8_t *const data_head =
  155|     75|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     75|  buffer->Advance(bytes_encoded);
  158|     75|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 49]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     49|  return true;
  162|     75|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   362k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     49|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     49|  ans_.read_end();
  167|     49|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    312|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    312|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    312|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 312]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    312|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    312|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    312|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 282]
  ------------------
   67|     30|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 29]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     30|  } else
   72|    282|#endif
   73|    282|  {
   74|    282|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 269]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    282|  }
   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|    298|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 26, False: 272]
  ------------------
   83|     26|    return false;
   84|     26|  }
   85|    272|  probability_table_.resize(num_symbols_);
   86|    272|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 265]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  51.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 50.8k, False: 157]
  ------------------
   91|  50.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|  50.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 57, False: 50.8k]
  ------------------
   95|     57|      return false;
   96|     57|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  50.8k|    const int token = prob_data & 3;
  102|  50.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 22.6k, False: 28.1k]
  ------------------
  103|  22.6k|      const uint32_t offset = prob_data >> 2;
  104|  22.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 22.6k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.10M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.07M, False: 22.6k]
  ------------------
  109|  1.07M|        probability_table_[i + j] = 0;
  110|  1.07M|      }
  111|  22.6k|      i += offset;
  112|  28.1k|    } else {
  113|  28.1k|      const int extra_bytes = token;
  114|  28.1k|      uint32_t prob = prob_data >> 2;
  115|  43.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 15.1k, False: 28.1k]
  ------------------
  116|  15.1k|        uint8_t eb;
  117|  15.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 15.1k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  15.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  15.1k|      }
  124|  28.1k|      probability_table_[i] = prob;
  125|  28.1k|    }
  126|  50.8k|  }
  127|    157|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 32, False: 125]
  ------------------
  128|     32|    return false;
  129|     32|  }
  130|    125|  return true;
  131|    157|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    132|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    125|    DecoderBuffer *buffer) {
  136|    125|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    125|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    125|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    125|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 123]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 0]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|      2|  } else
  145|    123|#endif
  146|    123|  {
  147|    123|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 120]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    123|  }
  151|    120|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 36, False: 84]
  ------------------
  152|     36|    return false;
  153|     36|  }
  154|     84|  const uint8_t *const data_head =
  155|     84|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     84|  buffer->Advance(bytes_encoded);
  158|     84|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 59]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     59|  return true;
  162|     84|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  3.50M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     59|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     59|  ans_.read_end();
  167|     59|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    355|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    355|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    355|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 355]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    355|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    355|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    355|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 44, False: 311]
  ------------------
   67|     44|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 42]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     44|  } else
   72|    311|#endif
   73|    311|  {
   74|    311|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 309]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    311|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    351|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 342]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    342|  probability_table_.resize(num_symbols_);
   86|    342|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 17, False: 325]
  ------------------
   87|     17|    return true;
   88|     17|  }
   89|       |  // Decode the table.
   90|   312k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 312k, False: 214]
  ------------------
   91|   312k|    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|   312k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 57, False: 312k]
  ------------------
   95|     57|      return false;
   96|     57|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   312k|    const int token = prob_data & 3;
  102|   312k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 33.7k, False: 278k]
  ------------------
  103|  33.7k|      const uint32_t offset = prob_data >> 2;
  104|  33.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 33.7k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.37M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.34M, False: 33.7k]
  ------------------
  109|  1.34M|        probability_table_[i + j] = 0;
  110|  1.34M|      }
  111|  33.7k|      i += offset;
  112|   278k|    } else {
  113|   278k|      const int extra_bytes = token;
  114|   278k|      uint32_t prob = prob_data >> 2;
  115|   366k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 88.3k, False: 278k]
  ------------------
  116|  88.3k|        uint8_t eb;
  117|  88.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 88.3k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  88.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  88.3k|      }
  124|   278k|      probability_table_[i] = prob;
  125|   278k|    }
  126|   312k|  }
  127|    214|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 49, False: 165]
  ------------------
  128|     49|    return false;
  129|     49|  }
  130|    165|  return true;
  131|    214|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    182|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_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: 32, False: 133]
  ------------------
  140|     32|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 31]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     32|  } else
  145|    133|#endif
  146|    133|  {
  147|    133|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 127]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    133|  }
  151|    158|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 48, False: 110]
  ------------------
  152|     48|    return false;
  153|     48|  }
  154|    110|  const uint8_t *const data_head =
  155|    110|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    110|  buffer->Advance(bytes_encoded);
  158|    110|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 77]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     77|  return true;
  162|    110|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  3.49M|  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|    320|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    320|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    320|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 320]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    320|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    320|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    320|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 286]
  ------------------
   67|     34|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 32]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     34|  } else
   72|    286|#endif
   73|    286|  {
   74|    286|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 278]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    286|  }
   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|    310|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 289]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    289|  probability_table_.resize(num_symbols_);
   86|    289|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 288]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  13.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 13.1k, False: 192]
  ------------------
   91|  13.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  13.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 53, False: 13.1k]
  ------------------
   95|     53|      return false;
   96|     53|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  13.1k|    const int token = prob_data & 3;
  102|  13.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.35k, False: 5.78k]
  ------------------
  103|  7.35k|      const uint32_t offset = prob_data >> 2;
  104|  7.35k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 7.33k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   257k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 250k, False: 7.33k]
  ------------------
  109|   250k|        probability_table_[i + j] = 0;
  110|   250k|      }
  111|  7.33k|      i += offset;
  112|  7.33k|    } else {
  113|  5.78k|      const int extra_bytes = token;
  114|  5.78k|      uint32_t prob = prob_data >> 2;
  115|  9.98k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.22k, False: 5.76k]
  ------------------
  116|  4.22k|        uint8_t eb;
  117|  4.22k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 4.20k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.20k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.20k|      }
  124|  5.76k|      probability_table_[i] = prob;
  125|  5.76k|    }
  126|  13.1k|  }
  127|    192|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 172]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    172|  return true;
  131|    192|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    173|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    172|    DecoderBuffer *buffer) {
  136|    172|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    172|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    172|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    172|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 18, False: 154]
  ------------------
  140|     18|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 16]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     18|  } else
  145|    154|#endif
  146|    154|  {
  147|    154|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 15, False: 139]
  ------------------
  148|     15|      return false;
  149|     15|    }
  150|    154|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 56, False: 99]
  ------------------
  152|     56|    return false;
  153|     56|  }
  154|     99|  const uint8_t *const data_head =
  155|     99|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     99|  buffer->Advance(bytes_encoded);
  158|     99|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 28, False: 71]
  ------------------
  159|     28|    return false;
  160|     28|  }
  161|     71|  return true;
  162|     99|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  28.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     71|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     71|  ans_.read_end();
  167|     71|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    317|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    317|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    317|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 317]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    317|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    317|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    317|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 46, False: 271]
  ------------------
   67|     46|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 45]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     46|  } else
   72|    271|#endif
   73|    271|  {
   74|    271|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 267]
  ------------------
   75|      4|      return false;
   76|      4|    }
   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|    312|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 298]
  ------------------
   83|     14|    return false;
   84|     14|  }
   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|  10.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 10.6k, False: 172]
  ------------------
   91|  10.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|  10.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 62, False: 10.5k]
  ------------------
   95|     62|      return false;
   96|     62|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  10.5k|    const int token = prob_data & 3;
  102|  10.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.06k, False: 6.50k]
  ------------------
  103|  4.06k|      const uint32_t offset = prob_data >> 2;
  104|  4.06k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 4.02k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   142k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 138k, False: 4.02k]
  ------------------
  109|   138k|        probability_table_[i + j] = 0;
  110|   138k|      }
  111|  4.02k|      i += offset;
  112|  6.50k|    } else {
  113|  6.50k|      const int extra_bytes = token;
  114|  6.50k|      uint32_t prob = prob_data >> 2;
  115|  10.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.02k, False: 6.48k]
  ------------------
  116|  4.02k|        uint8_t eb;
  117|  4.02k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 4.00k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.00k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.00k|      }
  124|  6.48k|      probability_table_[i] = prob;
  125|  6.48k|    }
  126|  10.5k|  }
  127|    172|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 152]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    152|  return true;
  131|    172|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    163|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    152|    DecoderBuffer *buffer) {
  136|    152|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    152|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    152|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    152|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 34, False: 118]
  ------------------
  140|     34|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 32]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     34|  } else
  145|    118|#endif
  146|    118|  {
  147|    118|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 116]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    118|  }
  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: 22, False: 63]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|     63|  return true;
  162|     85|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  17.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     63|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     63|  ans_.read_end();
  167|     63|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    303|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    303|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    303|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 303]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    303|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    303|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    303|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 67, False: 236]
  ------------------
   67|     67|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 66]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     67|  } else
   72|    236|#endif
   73|    236|  {
   74|    236|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 228]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    236|  }
   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|    294|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 18, False: 276]
  ------------------
   83|     18|    return false;
   84|     18|  }
   85|    276|  probability_table_.resize(num_symbols_);
   86|    276|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 271]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  72.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 72.5k, False: 167]
  ------------------
   91|  72.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|  72.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 72.5k]
  ------------------
   95|     47|      return false;
   96|     47|    }
   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|  72.5k|    const int token = prob_data & 3;
  102|  72.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 48.9k, False: 23.6k]
  ------------------
  103|  48.9k|      const uint32_t offset = prob_data >> 2;
  104|  48.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 48.8k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   548k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 499k, False: 48.8k]
  ------------------
  109|   499k|        probability_table_[i + j] = 0;
  110|   499k|      }
  111|  48.8k|      i += offset;
  112|  48.8k|    } else {
  113|  23.6k|      const int extra_bytes = token;
  114|  23.6k|      uint32_t prob = prob_data >> 2;
  115|  48.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 25.2k, False: 23.5k]
  ------------------
  116|  25.2k|        uint8_t eb;
  117|  25.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 25.2k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  25.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  25.2k|      }
  124|  23.5k|      probability_table_[i] = prob;
  125|  23.5k|    }
  126|  72.5k|  }
  127|    167|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 144]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    144|  return true;
  131|    167|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    149|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    144|    DecoderBuffer *buffer) {
  136|    144|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    144|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    144|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    144|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 55, False: 89]
  ------------------
  140|     55|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 54]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     55|  } else
  145|     89|#endif
  146|     89|  {
  147|     89|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 86]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     89|  }
  151|    140|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 71, False: 69]
  ------------------
  152|     71|    return false;
  153|     71|  }
  154|     69|  const uint8_t *const data_head =
  155|     69|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     69|  buffer->Advance(bytes_encoded);
  158|     69|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 62]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     62|  return true;
  162|     69|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  39.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     62|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     62|  ans_.read_end();
  167|     62|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  10.0k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  10.0k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 18, False: 10.0k]
  ------------------
   35|     18|    return true;
   36|     18|  }
   37|       |  // Decode which scheme to use.
   38|  10.0k|  uint8_t scheme;
   39|  10.0k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 131, False: 9.90k]
  ------------------
   40|    131|    return false;
   41|    131|  }
   42|  9.90k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.00k, False: 8.89k]
  ------------------
   43|  1.00k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.00k|                                                  src_buffer, out_values);
   45|  8.89k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 6.64k, False: 2.25k]
  ------------------
   46|  6.64k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  6.64k|                                               out_values);
   48|  6.64k|  }
   49|  2.25k|  return false;
   50|  9.90k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.00k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.00k|  SymbolDecoderT<5> tag_decoder;
   57|  1.00k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 407, False: 598]
  ------------------
   58|    407|    return false;
   59|    407|  }
   60|       |
   61|    598|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 280, False: 318]
  ------------------
   62|    280|    return false;
   63|    280|  }
   64|       |
   65|    318|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 318, False: 0]
  |  Branch (65:25): [True: 65, False: 253]
  ------------------
   66|     65|    return false;  // Wrong number of symbols.
   67|     65|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    253|  src_buffer->StartBitDecoding(false, nullptr);
   72|    253|  int value_id = 0;
   73|   811k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 810k, False: 253]
  ------------------
   74|       |    // Decode the tag.
   75|   810k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  2.04M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 1.22M, False: 810k]
  ------------------
   78|  1.22M|      uint32_t val;
   79|  1.22M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 1.22M]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|  1.22M|      out_values[value_id++] = val;
   83|  1.22M|    }
   84|   810k|  }
   85|    253|  tag_decoder.EndDecoding();
   86|    253|  src_buffer->EndBitDecoding();
   87|    253|  return true;
   88|    253|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  6.64k|                      uint32_t *out_values) {
  117|  6.64k|  uint8_t max_bit_length;
  118|  6.64k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 29, False: 6.61k]
  ------------------
  119|     29|    return false;
  120|     29|  }
  121|  6.61k|  switch (max_bit_length) {
  122|    525|    case 1:
  ------------------
  |  Branch (122:5): [True: 525, False: 6.09k]
  ------------------
  123|    525|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    525|                                                         out_values);
  125|    533|    case 2:
  ------------------
  |  Branch (125:5): [True: 533, False: 6.08k]
  ------------------
  126|    533|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    533|                                                         out_values);
  128|    355|    case 3:
  ------------------
  |  Branch (128:5): [True: 355, False: 6.26k]
  ------------------
  129|    355|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    355|                                                         out_values);
  131|    279|    case 4:
  ------------------
  |  Branch (131:5): [True: 279, False: 6.33k]
  ------------------
  132|    279|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    279|                                                         out_values);
  134|    231|    case 5:
  ------------------
  |  Branch (134:5): [True: 231, False: 6.38k]
  ------------------
  135|    231|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    231|                                                         out_values);
  137|    367|    case 6:
  ------------------
  |  Branch (137:5): [True: 367, False: 6.25k]
  ------------------
  138|    367|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    367|                                                         out_values);
  140|    382|    case 7:
  ------------------
  |  Branch (140:5): [True: 382, False: 6.23k]
  ------------------
  141|    382|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    382|                                                         out_values);
  143|    403|    case 8:
  ------------------
  |  Branch (143:5): [True: 403, False: 6.21k]
  ------------------
  144|    403|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    403|                                                         out_values);
  146|    309|    case 9:
  ------------------
  |  Branch (146:5): [True: 309, False: 6.30k]
  ------------------
  147|    309|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    309|                                                         out_values);
  149|    315|    case 10:
  ------------------
  |  Branch (149:5): [True: 315, False: 6.30k]
  ------------------
  150|    315|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    315|          num_values, src_buffer, out_values);
  152|    361|    case 11:
  ------------------
  |  Branch (152:5): [True: 361, False: 6.25k]
  ------------------
  153|    361|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    361|          num_values, src_buffer, out_values);
  155|    371|    case 12:
  ------------------
  |  Branch (155:5): [True: 371, False: 6.24k]
  ------------------
  156|    371|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    371|          num_values, src_buffer, out_values);
  158|    309|    case 13:
  ------------------
  |  Branch (158:5): [True: 309, False: 6.30k]
  ------------------
  159|    309|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    309|          num_values, src_buffer, out_values);
  161|    312|    case 14:
  ------------------
  |  Branch (161:5): [True: 312, False: 6.30k]
  ------------------
  162|    312|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    312|          num_values, src_buffer, out_values);
  164|    355|    case 15:
  ------------------
  |  Branch (164:5): [True: 355, False: 6.26k]
  ------------------
  165|    355|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    355|          num_values, src_buffer, out_values);
  167|    320|    case 16:
  ------------------
  |  Branch (167:5): [True: 320, False: 6.29k]
  ------------------
  168|    320|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    320|          num_values, src_buffer, out_values);
  170|    317|    case 17:
  ------------------
  |  Branch (170:5): [True: 317, False: 6.30k]
  ------------------
  171|    317|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    317|          num_values, src_buffer, out_values);
  173|    303|    case 18:
  ------------------
  |  Branch (173:5): [True: 303, False: 6.31k]
  ------------------
  174|    303|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    303|          num_values, src_buffer, out_values);
  176|    271|    default:
  ------------------
  |  Branch (176:5): [True: 271, False: 6.34k]
  ------------------
  177|    271|      return false;
  178|  6.61k|  }
  179|  6.61k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    525|                              uint32_t *out_values) {
   93|    525|  SymbolDecoderT decoder;
   94|    525|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 301, False: 224]
  ------------------
   95|    301|    return false;
   96|    301|  }
   97|       |
   98|    224|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 224, False: 0]
  |  Branch (98:25): [True: 16, False: 208]
  ------------------
   99|     16|    return false;  // Wrong number of symbols.
  100|     16|  }
  101|       |
  102|    208|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 66, False: 142]
  ------------------
  103|     66|    return false;
  104|     66|  }
  105|  38.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 38.7M, False: 142]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  38.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  38.7M|    out_values[i] = value;
  109|  38.7M|  }
  110|    142|  decoder.EndDecoding();
  111|    142|  return true;
  112|    208|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    533|                              uint32_t *out_values) {
   93|    533|  SymbolDecoderT decoder;
   94|    533|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 204, False: 329]
  ------------------
   95|    204|    return false;
   96|    204|  }
   97|       |
   98|    329|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 329, False: 0]
  |  Branch (98:25): [True: 14, False: 315]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    315|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 116, False: 199]
  ------------------
  103|    116|    return false;
  104|    116|  }
  105|  6.05M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.05M, False: 199]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.05M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.05M|    out_values[i] = value;
  109|  6.05M|  }
  110|    199|  decoder.EndDecoding();
  111|    199|  return true;
  112|    315|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    355|                              uint32_t *out_values) {
   93|    355|  SymbolDecoderT decoder;
   94|    355|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 146, False: 209]
  ------------------
   95|    146|    return false;
   96|    146|  }
   97|       |
   98|    209|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 209, False: 0]
  |  Branch (98:25): [True: 7, False: 202]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    202|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 113, False: 89]
  ------------------
  103|    113|    return false;
  104|    113|  }
  105|  7.16M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.16M, False: 89]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.16M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.16M|    out_values[i] = value;
  109|  7.16M|  }
  110|     89|  decoder.EndDecoding();
  111|     89|  return true;
  112|    202|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    279|                              uint32_t *out_values) {
   93|    279|  SymbolDecoderT decoder;
   94|    279|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 148, False: 131]
  ------------------
   95|    148|    return false;
   96|    148|  }
   97|       |
   98|    131|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 131, False: 0]
  |  Branch (98:25): [True: 9, False: 122]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    122|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 37, False: 85]
  ------------------
  103|     37|    return false;
  104|     37|  }
  105|  1.11M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.11M, False: 85]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.11M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.11M|    out_values[i] = value;
  109|  1.11M|  }
  110|     85|  decoder.EndDecoding();
  111|     85|  return true;
  112|    122|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    231|                              uint32_t *out_values) {
   93|    231|  SymbolDecoderT decoder;
   94|    231|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 25, False: 206]
  ------------------
   95|     25|    return false;
   96|     25|  }
   97|       |
   98|    206|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 206, False: 0]
  |  Branch (98:25): [True: 117, False: 89]
  ------------------
   99|    117|    return false;  // Wrong number of symbols.
  100|    117|  }
  101|       |
  102|     89|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 21, False: 68]
  ------------------
  103|     21|    return false;
  104|     21|  }
  105|   736k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 735k, False: 68]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   735k|    const uint32_t value = decoder.DecodeSymbol();
  108|   735k|    out_values[i] = value;
  109|   735k|  }
  110|     68|  decoder.EndDecoding();
  111|     68|  return true;
  112|     89|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    367|                              uint32_t *out_values) {
   93|    367|  SymbolDecoderT decoder;
   94|    367|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 147, False: 220]
  ------------------
   95|    147|    return false;
   96|    147|  }
   97|       |
   98|    220|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 220, False: 0]
  |  Branch (98:25): [True: 7, False: 213]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    213|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 103, False: 110]
  ------------------
  103|    103|    return false;
  104|    103|  }
  105|  12.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.5M, False: 110]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.5M|    out_values[i] = value;
  109|  12.5M|  }
  110|    110|  decoder.EndDecoding();
  111|    110|  return true;
  112|    213|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    382|                              uint32_t *out_values) {
   93|    382|  SymbolDecoderT decoder;
   94|    382|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 190, False: 192]
  ------------------
   95|    190|    return false;
   96|    190|  }
   97|       |
   98|    192|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 192, False: 0]
  |  Branch (98:25): [True: 15, False: 177]
  ------------------
   99|     15|    return false;  // Wrong number of symbols.
  100|     15|  }
  101|       |
  102|    177|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 92, False: 85]
  ------------------
  103|     92|    return false;
  104|     92|  }
  105|  7.92M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.92M, False: 85]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.92M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.92M|    out_values[i] = value;
  109|  7.92M|  }
  110|     85|  decoder.EndDecoding();
  111|     85|  return true;
  112|    177|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    403|                              uint32_t *out_values) {
   93|    403|  SymbolDecoderT decoder;
   94|    403|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 194, False: 209]
  ------------------
   95|    194|    return false;
   96|    194|  }
   97|       |
   98|    209|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 209, False: 0]
  |  Branch (98:25): [True: 4, False: 205]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    205|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 138, False: 67]
  ------------------
  103|    138|    return false;
  104|    138|  }
  105|  2.11M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.11M, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.11M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.11M|    out_values[i] = value;
  109|  2.11M|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|    205|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    309|                              uint32_t *out_values) {
   93|    309|  SymbolDecoderT decoder;
   94|    309|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 182, False: 127]
  ------------------
   95|    182|    return false;
   96|    182|  }
   97|       |
   98|    127|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 127, False: 0]
  |  Branch (98:25): [True: 10, False: 117]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    117|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 74, False: 43]
  ------------------
  103|     74|    return false;
  104|     74|  }
  105|   133k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 133k, False: 43]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   133k|    const uint32_t value = decoder.DecodeSymbol();
  108|   133k|    out_values[i] = value;
  109|   133k|  }
  110|     43|  decoder.EndDecoding();
  111|     43|  return true;
  112|    117|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    315|                              uint32_t *out_values) {
   93|    315|  SymbolDecoderT decoder;
   94|    315|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 187, False: 128]
  ------------------
   95|    187|    return false;
   96|    187|  }
   97|       |
   98|    128|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 128, False: 0]
  |  Branch (98:25): [True: 5, False: 123]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    123|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 65, False: 58]
  ------------------
  103|     65|    return false;
  104|     65|  }
  105|   404k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 404k, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   404k|    const uint32_t value = decoder.DecodeSymbol();
  108|   404k|    out_values[i] = value;
  109|   404k|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    123|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    361|                              uint32_t *out_values) {
   93|    361|  SymbolDecoderT decoder;
   94|    361|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 216, False: 145]
  ------------------
   95|    216|    return false;
   96|    216|  }
   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: 105, False: 34]
  ------------------
  103|    105|    return false;
  104|    105|  }
  105|  41.9k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 41.8k, False: 34]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  41.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  41.8k|    out_values[i] = value;
  109|  41.8k|  }
  110|     34|  decoder.EndDecoding();
  111|     34|  return true;
  112|    139|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    371|                              uint32_t *out_values) {
   93|    371|  SymbolDecoderT decoder;
   94|    371|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 215, False: 156]
  ------------------
   95|    215|    return false;
   96|    215|  }
   97|       |
   98|    156|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 156, False: 0]
  |  Branch (98:25): [True: 9, False: 147]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    147|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 96, False: 51]
  ------------------
  103|     96|    return false;
  104|     96|  }
  105|   167k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 167k, False: 51]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   167k|    const uint32_t value = decoder.DecodeSymbol();
  108|   167k|    out_values[i] = value;
  109|   167k|  }
  110|     51|  decoder.EndDecoding();
  111|     51|  return true;
  112|    147|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    309|                              uint32_t *out_values) {
   93|    309|  SymbolDecoderT decoder;
   94|    309|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 177, False: 132]
  ------------------
   95|    177|    return false;
   96|    177|  }
   97|       |
   98|    132|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 132, False: 0]
  |  Branch (98:25): [True: 13, False: 119]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    119|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 70, False: 49]
  ------------------
  103|     70|    return false;
  104|     70|  }
  105|   362k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 362k, False: 49]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   362k|    const uint32_t value = decoder.DecodeSymbol();
  108|   362k|    out_values[i] = value;
  109|   362k|  }
  110|     49|  decoder.EndDecoding();
  111|     49|  return true;
  112|    119|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    312|                              uint32_t *out_values) {
   93|    312|  SymbolDecoderT decoder;
   94|    312|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 180, False: 132]
  ------------------
   95|    180|    return false;
   96|    180|  }
   97|       |
   98|    132|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 132, False: 0]
  |  Branch (98:25): [True: 7, False: 125]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    125|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 66, False: 59]
  ------------------
  103|     66|    return false;
  104|     66|  }
  105|  3.50M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.50M, False: 59]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.50M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.50M|    out_values[i] = value;
  109|  3.50M|  }
  110|     59|  decoder.EndDecoding();
  111|     59|  return true;
  112|    125|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    355|                              uint32_t *out_values) {
   93|    355|  SymbolDecoderT decoder;
   94|    355|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 173, False: 182]
  ------------------
   95|    173|    return false;
   96|    173|  }
   97|       |
   98|    182|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 182, False: 0]
  |  Branch (98:25): [True: 17, False: 165]
  ------------------
   99|     17|    return false;  // Wrong number of symbols.
  100|     17|  }
  101|       |
  102|    165|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 88, False: 77]
  ------------------
  103|     88|    return false;
  104|     88|  }
  105|  3.49M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.49M, False: 77]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.49M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.49M|    out_values[i] = value;
  109|  3.49M|  }
  110|     77|  decoder.EndDecoding();
  111|     77|  return true;
  112|    165|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    320|                              uint32_t *out_values) {
   93|    320|  SymbolDecoderT decoder;
   94|    320|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 147, False: 173]
  ------------------
   95|    147|    return false;
   96|    147|  }
   97|       |
   98|    173|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 173, False: 0]
  |  Branch (98:25): [True: 1, False: 172]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    172|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 101, False: 71]
  ------------------
  103|    101|    return false;
  104|    101|  }
  105|  28.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 28.0M, False: 71]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  28.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  28.0M|    out_values[i] = value;
  109|  28.0M|  }
  110|     71|  decoder.EndDecoding();
  111|     71|  return true;
  112|    172|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    317|                              uint32_t *out_values) {
   93|    317|  SymbolDecoderT decoder;
   94|    317|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 154, False: 163]
  ------------------
   95|    154|    return false;
   96|    154|  }
   97|       |
   98|    163|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 163, False: 0]
  |  Branch (98:25): [True: 11, False: 152]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    152|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 89, False: 63]
  ------------------
  103|     89|    return false;
  104|     89|  }
  105|  17.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 17.3M, False: 63]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  17.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  17.3M|    out_values[i] = value;
  109|  17.3M|  }
  110|     63|  decoder.EndDecoding();
  111|     63|  return true;
  112|    152|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    303|                              uint32_t *out_values) {
   93|    303|  SymbolDecoderT decoder;
   94|    303|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 154, False: 149]
  ------------------
   95|    154|    return false;
   96|    154|  }
   97|       |
   98|    149|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 149, False: 0]
  |  Branch (98:25): [True: 5, False: 144]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    144|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 82, False: 62]
  ------------------
  103|     82|    return false;
  104|     82|  }
  105|  39.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 39.6M, False: 62]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  39.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  39.6M|    out_values[i] = value;
  109|  39.6M|  }
  110|     62|  decoder.EndDecoding();
  111|     62|  return true;
  112|    144|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  2.49k|    : decoder_(nullptr),
   49|  2.49k|      last_symbol_id_(-1),
   50|  2.49k|      last_vert_id_(-1),
   51|  2.49k|      last_face_id_(-1),
   52|  2.49k|      num_new_vertices_(0),
   53|  2.49k|      num_encoded_vertices_(0),
   54|  2.49k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.49k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.49k|  decoder_ = decoder;
   60|  2.49k|  return true;
   61|  2.49k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  2.17k|    int att_id) const {
   67|  3.61k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 3.11k, False: 500]
  ------------------
   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.44k, False: 1.67k]
  |  Branch (69:27): [True: 0, False: 1.67k]
  ------------------
   70|  1.44k|      continue;
   71|  1.44k|    }
   72|  1.67k|    const AttributesDecoderInterface *const dec =
   73|  1.67k|        decoder_->attributes_decoder(decoder_id);
   74|  4.10k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 4.10k, False: 0]
  ------------------
   75|  4.10k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.67k, False: 2.43k]
  ------------------
   76|  1.67k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.11k, False: 558]
  ------------------
   77|  1.11k|          return &attribute_data_[i].connectivity_data;
   78|  1.11k|        }
   79|    558|        return nullptr;
   80|  1.67k|      }
   81|  4.10k|    }
   82|  1.67k|  }
   83|    500|  return nullptr;
   84|  2.17k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  2.17k|    int att_id) const {
   90|  3.61k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 3.11k, False: 500]
  ------------------
   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.44k, False: 1.67k]
  |  Branch (92:27): [True: 0, False: 1.67k]
  ------------------
   93|  1.44k|      continue;
   94|  1.44k|    }
   95|  1.67k|    const AttributesDecoderInterface *const dec =
   96|  1.67k|        decoder_->attributes_decoder(decoder_id);
   97|  4.10k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 4.10k, False: 0]
  ------------------
   98|  4.10k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.67k, False: 2.43k]
  ------------------
   99|  1.67k|        return &attribute_data_[i].encoding_data;
  100|  1.67k|      }
  101|  4.10k|    }
  102|  1.67k|  }
  103|    500|  return &pos_encoding_data_;
  104|  2.17k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  1.71k|    int32_t att_decoder_id) {
  131|  1.71k|  int8_t att_data_id;
  132|  1.71k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 16, False: 1.69k]
  ------------------
  133|     16|    return false;
  134|     16|  }
  135|  1.69k|  uint8_t decoder_type;
  136|  1.69k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 8, False: 1.68k]
  ------------------
  137|      8|    return false;
  138|      8|  }
  139|       |
  140|  1.68k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.24k, False: 440]
  ------------------
  141|  1.24k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 57, False: 1.19k]
  ------------------
  142|     57|      return false;  // Unexpected attribute data.
  143|     57|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.19k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 10, False: 1.18k]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|       |
  151|  1.18k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.18k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    440|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 438]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|    438|    pos_data_decoder_id_ = att_decoder_id;
  158|    438|  }
  159|       |
  160|  1.61k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.61k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.61k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.61k, False: 1]
  ------------------
  162|  1.61k|    uint8_t traversal_method_encoded;
  163|  1.61k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 15, False: 1.60k]
  ------------------
  164|     15|      return false;
  165|     15|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.60k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 46, False: 1.55k]
  ------------------
  168|     46|      return false;
  169|     46|    }
  170|  1.55k|    traversal_method =
  171|  1.55k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.55k|  }
  173|       |
  174|  1.55k|  const Mesh *mesh = decoder_->mesh();
  175|  1.55k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.55k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 752, False: 805]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    752|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    752|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 395, False: 357]
  ------------------
  182|    395|      encoding_data = &pos_encoding_data_;
  183|    395|    } else {
  184|    357|      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|    357|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    357|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    752|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 135, False: 617]
  ------------------
  191|    135|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    135|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    135|          AttTraverser;
  194|    135|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    617|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 617, False: 0]
  ------------------
  196|    617|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    617|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    617|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    617|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    805|  } else {
  203|    805|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 5, False: 800]
  ------------------
  204|      5|      return false;  // Unsupported method.
  205|      5|    }
  206|    800|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 798]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    798|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    798|        AttObserver;
  214|    798|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    798|        AttTraverser;
  216|       |
  217|    798|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    798|        &attribute_data_[att_data_id].encoding_data;
  219|    798|    const MeshAttributeCornerTable *const corner_table =
  220|    798|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    798|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    798|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    798|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    798|                             encoding_data);
  227|       |
  228|    798|    AttTraverser att_traverser;
  229|    798|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    798|    traversal_sequencer->SetTraverser(att_traverser);
  232|    798|    sequencer = std::move(traversal_sequencer);
  233|    798|  }
  234|       |
  235|  1.55k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.55k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.55k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.55k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.55k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.55k|                                        std::move(att_controller));
  244|  1.55k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  2.49k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.49k|  num_new_vertices_ = 0;
  249|  2.49k|  new_to_parent_vertex_map_.clear();
  250|  2.49k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.49k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.49k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 545, False: 1.94k]
  ------------------
  252|    545|    uint32_t num_new_verts;
  253|    545|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    545|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 158, False: 387]
  ------------------
  254|    158|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 9, False: 149]
  ------------------
  255|      9|        return false;
  256|      9|      }
  257|    387|    } else {
  258|    387|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 1, False: 386]
  ------------------
  259|      1|        return false;
  260|      1|      }
  261|    387|    }
  262|    535|    num_new_vertices_ = num_new_verts;
  263|    535|  }
  264|  2.48k|#endif
  265|       |
  266|  2.48k|  uint32_t num_encoded_vertices;
  267|  2.48k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.48k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 149, False: 2.33k]
  ------------------
  269|    149|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 2, False: 147]
  ------------------
  270|      2|      return false;
  271|      2|    }
  272|       |
  273|    149|  } else
  274|  2.33k|#endif
  275|  2.33k|  {
  276|  2.33k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 1, False: 2.33k]
  ------------------
  277|      1|      return false;
  278|      1|    }
  279|  2.33k|  }
  280|  2.47k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.47k|  uint32_t num_faces;
  283|  2.47k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.47k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.47k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 147, False: 2.33k]
  ------------------
  285|    147|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 2, False: 145]
  ------------------
  286|      2|      return false;
  287|      2|    }
  288|       |
  289|    147|  } else
  290|  2.33k|#endif
  291|  2.33k|  {
  292|  2.33k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 2, False: 2.33k]
  ------------------
  293|      2|      return false;
  294|      2|    }
  295|  2.33k|  }
  296|  2.47k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 5, False: 2.47k]
  ------------------
  297|      5|    return false;  // Draco cannot handle this many faces.
  298|      5|  }
  299|       |
  300|  2.47k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 22, False: 2.44k]
  ------------------
  301|     22|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     22|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.44k|  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.44k|  const uint64_t num_encoded_vertices_64 =
  311|  2.44k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.44k|  const uint64_t max_num_vertex_edges =
  313|  2.44k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.44k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 7, False: 2.44k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      7|    return false;
  317|      7|  }
  318|       |
  319|  2.44k|  uint8_t num_attribute_data;
  320|  2.44k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 25, False: 2.41k]
  ------------------
  321|     25|    return false;
  322|     25|  }
  323|       |
  324|  2.41k|  uint32_t num_encoded_symbols;
  325|  2.41k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.41k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.41k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 130, False: 2.28k]
  ------------------
  327|    130|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 8, False: 122]
  ------------------
  328|      8|      return false;
  329|      8|    }
  330|       |
  331|    130|  } else
  332|  2.28k|#endif
  333|  2.28k|  {
  334|  2.28k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 7, False: 2.27k]
  ------------------
  335|      7|      return false;
  336|      7|    }
  337|  2.28k|  }
  338|       |
  339|  2.40k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 17, False: 2.38k]
  ------------------
  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|     17|    return false;
  344|     17|  }
  345|  2.38k|  const uint32_t max_encoded_faces =
  346|  2.38k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.38k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 33, False: 2.35k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|     33|    return false;
  352|     33|  }
  353|       |
  354|  2.35k|  uint32_t num_encoded_split_symbols;
  355|  2.35k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.35k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.35k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 100, False: 2.25k]
  ------------------
  357|    100|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 5, False: 95]
  ------------------
  358|      5|      return false;
  359|      5|    }
  360|       |
  361|    100|  } else
  362|  2.25k|#endif
  363|  2.25k|  {
  364|  2.25k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 7, False: 2.24k]
  ------------------
  365|      7|      return false;
  366|      7|    }
  367|  2.25k|  }
  368|       |
  369|  2.33k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 25, False: 2.31k]
  ------------------
  370|     25|    return false;  // Split symbols are a sub-set of all symbols.
  371|     25|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.31k|  vertex_traversal_length_.clear();
  375|  2.31k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.31k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.31k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.31k|  processed_corner_ids_.clear();
  380|  2.31k|  processed_corner_ids_.reserve(num_faces);
  381|  2.31k|  processed_connectivity_corners_.clear();
  382|  2.31k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.31k|  topology_split_data_.clear();
  384|  2.31k|  hole_event_data_.clear();
  385|  2.31k|  init_face_configurations_.clear();
  386|  2.31k|  init_corners_.clear();
  387|       |
  388|  2.31k|  last_symbol_id_ = -1;
  389|  2.31k|  last_face_id_ = -1;
  390|  2.31k|  last_vert_id_ = -1;
  391|       |
  392|  2.31k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.31k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.31k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.31k]
  ------------------
  397|  2.31k|          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.31k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.31k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.31k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.31k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.31k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 463, False: 1.85k]
  ------------------
  411|    463|    uint32_t encoded_connectivity_size;
  412|    463|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    463|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 93, False: 370]
  ------------------
  413|     93|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 5, False: 88]
  ------------------
  414|      5|        return false;
  415|      5|      }
  416|    370|    } else {
  417|    370|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 1, False: 369]
  ------------------
  418|      1|        return false;
  419|      1|      }
  420|    370|    }
  421|    457|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 456]
  ------------------
  422|    456|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 31, False: 425]
  ------------------
  423|     32|      return false;
  424|     32|    }
  425|    425|    DecoderBuffer event_buffer;
  426|    425|    event_buffer.Init(
  427|    425|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    425|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    425|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    425|    topology_split_decoded_bytes =
  432|    425|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    425|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 107, False: 318]
  ------------------
  434|    107|      return false;
  435|    107|    }
  436|       |
  437|    425|  } else
  438|  1.85k|#endif
  439|  1.85k|  {
  440|  1.85k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 74, False: 1.77k]
  ------------------
  441|     74|      return false;
  442|     74|    }
  443|  1.85k|  }
  444|       |
  445|  2.09k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.09k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.09k|                                           num_encoded_split_symbols);
  449|  2.09k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.09k|  DecoderBuffer traversal_end_buffer;
  452|  2.09k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 167, False: 1.92k]
  ------------------
  453|    167|    return false;
  454|    167|  }
  455|       |
  456|  1.92k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.92k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 227, False: 1.70k]
  ------------------
  458|    227|    return false;
  459|    227|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.70k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.70k|                           traversal_end_buffer.remaining_size(),
  464|  1.70k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.70k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.70k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.70k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 221, False: 1.48k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    221|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    221|  }
  471|  1.70k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.70k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.64k, False: 60]
  ------------------
  475|  1.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.64k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 216, False: 1.42k]
  ------------------
  477|  1.59k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.37k, False: 216]
  ------------------
  478|  1.37k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.37k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.37k|      }
  482|       |
  483|    216|    } else
  484|  1.42k|#endif
  485|  1.42k|    {
  486|   280k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 278k, False: 1.42k]
  ------------------
  487|   278k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 278k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   278k|      }
  491|  1.42k|    }
  492|  1.64k|  }
  493|  1.70k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  5.34k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 3.64k, False: 1.70k]
  ------------------
  498|  3.64k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  3.38M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 3.38M, False: 3.64k]
  ------------------
  501|  3.38M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  3.38M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  3.64k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 3.64k]
  ------------------
  505|  3.64k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  3.64k|  }
  509|       |
  510|  1.70k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  5.34k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 3.64k, False: 1.70k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  3.64k|    int32_t att_connectivity_verts =
  517|  3.64k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  3.64k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 218, False: 3.42k]
  ------------------
  519|    218|      att_connectivity_verts = corner_table_->num_vertices();
  520|    218|    }
  521|  3.64k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  3.64k|  }
  523|  1.70k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 5, False: 1.69k]
  ------------------
  524|      5|    return false;
  525|      5|  }
  526|  1.69k|  return true;
  527|  1.70k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    404|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    404|  return true;
  532|    404|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  1.92k|    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.92k|  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.92k|  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.92k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.92k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.92k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.92k|  int num_faces = 0;
  562|  6.66M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 6.66M, False: 1.75k]
  ------------------
  563|  6.66M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  6.66M|    bool check_topology_split = false;
  566|  6.66M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  6.66M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 2.96M, False: 3.69M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  2.96M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 2, False: 2.96M]
  ------------------
  588|      2|        return -1;
  589|      2|      }
  590|       |
  591|  2.96M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  2.96M|      const VertexIndex vertex_x =
  593|  2.96M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  2.96M|      const CornerIndex corner_b =
  595|  2.96M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  2.96M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 126, False: 2.96M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    126|        return -1;
  600|    126|      }
  601|  2.96M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 2.96M]
  |  Branch (601:11): [True: 0, False: 2.96M]
  ------------------
  602|  2.96M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 2.96M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  2.96M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  2.96M|      SetOppositeCorners(corner_a, corner + 1);
  612|  2.96M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  2.96M|      const VertexIndex vert_a_prev =
  616|  2.96M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  2.96M|      const VertexIndex vert_b_next =
  618|  2.96M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  2.96M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 2.96M]
  |  Branch (619:38): [True: 0, False: 2.96M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  2.96M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  2.96M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  2.96M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  2.96M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  2.96M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  2.96M|      active_corner_stack.back() = corner;
  631|  3.69M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 980k, False: 2.71M]
  |  Branch (631:40): [True: 449k, False: 2.26M]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  1.43M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 2, False: 1.43M]
  ------------------
  647|      2|        return -1;
  648|      2|      }
  649|  1.43M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  1.43M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 1.43M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  1.43M|      const CornerIndex corner(3 * face.value());
  658|  1.43M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  1.43M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 980k, False: 449k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|   980k|        opp_corner = corner + 2;
  662|   980k|        corner_l = corner + 1;
  663|   980k|        corner_r = corner;
  664|   980k|      } else {
  665|       |        // "l" is the new first corner.
  666|   449k|        opp_corner = corner + 1;
  667|   449k|        corner_l = corner;
  668|   449k|        corner_r = corner + 2;
  669|   449k|      }
  670|  1.43M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  1.43M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  1.43M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 1, False: 1.43M]
  ------------------
  675|      1|        return -1;  // Unexpected number of decoded vertices.
  676|      1|      }
  677|       |
  678|  1.43M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  1.43M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  1.43M|      const VertexIndex vertex_r =
  682|  1.43M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  1.43M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  1.43M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  1.43M|      corner_table_->MapCornerToVertex(
  688|  1.43M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  1.43M|      active_corner_stack.back() = corner;
  690|  1.43M|      check_topology_split = true;
  691|  2.26M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 726k, False: 1.54M]
  ------------------
  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|   726k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 2, False: 726k]
  ------------------
  703|      2|        return -1;
  704|      2|      }
  705|   726k|      const CornerIndex corner_b = active_corner_stack.back();
  706|   726k|      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|   726k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|   726k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 45, False: 726k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     45|        active_corner_stack.push_back(it->second);
  714|     45|      }
  715|   726k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 14, False: 726k]
  ------------------
  716|     14|        return -1;
  717|     14|      }
  718|   726k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|   726k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 726k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|   726k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 8, False: 726k]
  |  Branch (724:11): [True: 8, False: 726k]
  ------------------
  725|   726k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 726k]
  ------------------
  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|   726k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|   726k|      SetOppositeCorners(corner_a, corner + 2);
  735|   726k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|   726k|      const VertexIndex vertex_p =
  739|   726k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|   726k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|   726k|      corner_table_->MapCornerToVertex(
  742|   726k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|   726k|      const VertexIndex vert_b_prev =
  744|   726k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|   726k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|   726k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|   726k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|   726k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|   726k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|   726k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|   726k|                                       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|   726k|      const CornerIndex first_corner = corner_n;
  757|  4.57M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 3.85M, False: 726k]
  ------------------
  758|  3.85M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  3.85M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  3.85M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 2, False: 3.85M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      2|          return -1;
  764|      2|        }
  765|  3.85M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|   726k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|   726k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 16.2k, False: 710k]
  ------------------
  770|  16.2k|        invalid_vertices.push_back(vertex_n);
  771|  16.2k|      }
  772|   726k|      active_corner_stack.back() = corner;
  773|  1.54M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 1.54M, False: 0]
  ------------------
  774|  1.54M|      const CornerIndex corner(3 * face.value());
  775|  1.54M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  1.54M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  1.54M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  1.54M|                                       corner_table_->AddNewVertex());
  780|  1.54M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  1.54M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  1.54M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 1.54M]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  1.54M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  1.54M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  1.54M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  1.54M|      active_corner_stack.push_back(corner);
  792|  1.54M|      check_topology_split = true;
  793|  1.54M|    } 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|  6.66M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  6.66M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 2.97M, False: 3.69M]
  ------------------
  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|  2.97M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  2.97M|      EdgeFaceName split_edge;
  812|  2.97M|      int encoder_split_symbol_id;
  813|  2.97M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.30k, False: 2.97M]
  ------------------
  814|  2.97M|                             &encoder_split_symbol_id)) {
  815|  1.30k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 18, False: 1.29k]
  ------------------
  816|     18|          return -1;  // Wrong split symbol id.
  817|     18|        }
  818|       |        // Symbol was part of a topology split. Now we need to determine which
  819|       |        // edge should be added to the active edges stack.
  820|  1.29k|        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.29k|        CornerIndex new_active_corner;
  831|  1.29k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 471, False: 820]
  ------------------
  832|    471|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    820|        } else {
  834|    820|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    820|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.29k|        const int decoder_split_symbol_id =
  839|  1.29k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.29k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.29k|            new_active_corner;
  842|  1.29k|      }
  843|  2.97M|    }
  844|  6.66M|  }
  845|  1.75k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.75k]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  28.0k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 26.3k, False: 1.72k]
  ------------------
  850|  26.3k|    const CornerIndex corner = active_corner_stack.back();
  851|  26.3k|    active_corner_stack.pop_back();
  852|  26.3k|    const bool interior_face =
  853|  26.3k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  26.3k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 18.9k, False: 7.37k]
  ------------------
  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|  18.9k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 5, False: 18.9k]
  ------------------
  877|      5|        return -1;  // More faces than expected added to the mesh.
  878|      5|      }
  879|       |
  880|  18.9k|      const CornerIndex corner_a = corner;
  881|  18.9k|      const VertexIndex vert_n =
  882|  18.9k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  18.9k|      const CornerIndex corner_b =
  884|  18.9k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  18.9k|      const VertexIndex vert_x =
  887|  18.9k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  18.9k|      const CornerIndex corner_c =
  889|  18.9k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  18.9k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 15, False: 18.9k]
  |  Branch (891:33): [True: 9, False: 18.9k]
  |  Branch (891:55): [True: 0, False: 18.9k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     24|        return -1;
  894|     24|      }
  895|  18.9k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 18.8k]
  |  Branch (895:11): [True: 1, False: 18.8k]
  ------------------
  896|  18.8k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 18.8k]
  ------------------
  897|  18.8k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 18.8k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      1|        return -1;
  901|      1|      }
  902|       |
  903|  18.8k|      const VertexIndex vert_p =
  904|  18.8k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  18.8k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  18.8k|      const CornerIndex new_corner(3 * face.value());
  909|  18.8k|      SetOppositeCorners(new_corner, corner);
  910|  18.8k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  18.8k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  18.8k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  18.8k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  18.8k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  75.5k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 56.6k, False: 18.8k]
  ------------------
  920|  56.6k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  56.6k|      }
  922|       |
  923|  18.8k|      init_face_configurations_.push_back(true);
  924|  18.8k|      init_corners_.push_back(new_corner);
  925|  18.8k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  7.37k|      init_face_configurations_.push_back(false);
  930|  7.37k|      init_corners_.push_back(corner);
  931|  7.37k|    }
  932|  26.3k|  }
  933|  1.72k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 16, False: 1.70k]
  ------------------
  934|     16|    return -1;  // Unexpected number of decoded faces.
  935|     16|  }
  936|       |
  937|  1.70k|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  1.70k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 606, False: 1.70k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    606|    VertexIndex src_vert(num_vertices - 1);
  943|    734|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 128, False: 606]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    128|      src_vert = VertexIndex(--num_vertices - 1);
  946|    128|    }
  947|    606|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 128, False: 478]
  ------------------
  948|    128|      continue;  // No need to swap anything.
  949|    128|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    478|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  3.33k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 2.86k, False: 475]
  ------------------
  954|  2.86k|      const CornerIndex cid = vcit.Corner();
  955|  2.86k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 3, False: 2.85k]
  ------------------
  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|  2.85k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  2.85k|    }
  962|    475|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    475|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    475|    corner_table_->MakeVertexIsolated(src_vert);
  967|    475|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    475|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    475|    num_vertices--;
  972|    475|  }
  973|  1.70k|  return num_vertices;
  974|  1.70k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.27k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.27k|  uint32_t num_topology_splits;
  982|  2.27k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.27k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.27k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 79, False: 2.19k]
  ------------------
  984|     79|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 78]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|     79|  } else
  989|  2.19k|#endif
  990|  2.19k|  {
  991|  2.19k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 6, False: 2.19k]
  ------------------
  992|      6|      return -1;
  993|      6|    }
  994|  2.19k|  }
  995|  2.26k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.23k, False: 1.03k]
  ------------------
  996|  1.23k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 34, False: 1.20k]
  ------------------
  997|  1.23k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     34|      return -1;
  999|     34|    }
 1000|  1.20k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.20k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.20k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 33, False: 1.16k]
  ------------------
 1002|  34.7k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 34.7k, False: 11]
  ------------------
 1003|  34.7k|        TopologySplitEventData event_data;
 1004|  34.7k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 12, False: 34.7k]
  ------------------
 1005|     12|          return -1;
 1006|     12|        }
 1007|  34.7k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 6, False: 34.6k]
  ------------------
 1008|      6|          return -1;
 1009|      6|        }
 1010|  34.6k|        uint8_t edge_data;
 1011|  34.6k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 34.6k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|  34.6k|        event_data.source_edge = edge_data & 1;
 1015|  34.6k|        topology_split_data_.push_back(event_data);
 1016|  34.6k|      }
 1017|       |
 1018|     33|    } else
 1019|  1.16k|#endif
 1020|  1.16k|    {
 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.16k|      int last_source_symbol_id = 0;
 1024|  6.14k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 5.01k, False: 1.12k]
  ------------------
 1025|  5.01k|        TopologySplitEventData event_data;
 1026|  5.01k|        uint32_t delta;
 1027|  5.01k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 10, False: 5.00k]
  ------------------
 1028|     10|          return -1;
 1029|     10|        }
 1030|  5.00k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  5.00k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 6, False: 5.00k]
  ------------------
 1032|      6|          return -1;
 1033|      6|        }
 1034|  5.00k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 25, False: 4.97k]
  ------------------
 1035|     25|          return -1;
 1036|     25|        }
 1037|  4.97k|        event_data.split_symbol_id =
 1038|  4.97k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.97k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.97k|        topology_split_data_.push_back(event_data);
 1041|  4.97k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.12k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  5.58k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.46k, False: 1.12k]
  ------------------
 1045|  4.46k|        uint32_t edge_data;
 1046|  4.46k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.46k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.48k, False: 2.97k]
  ------------------
 1047|  1.48k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.97k|        } else {
 1049|  2.97k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.97k|        }
 1051|  4.46k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  4.46k|        event_data.source_edge = edge_data & 1;
 1053|  4.46k|      }
 1054|  1.12k|      decoder_buffer->EndBitDecoding();
 1055|  1.12k|    }
 1056|  1.20k|  }
 1057|  2.17k|  uint32_t num_hole_events = 0;
 1058|  2.17k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.17k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.17k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 54, False: 2.11k]
  ------------------
 1060|     54|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 8, False: 46]
  ------------------
 1061|      8|      return -1;
 1062|      8|    }
 1063|  2.11k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.11k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 331, False: 1.78k]
  ------------------
 1064|    331|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 6, False: 325]
  ------------------
 1065|      6|      return -1;
 1066|      6|    }
 1067|    331|  }
 1068|  2.15k|#endif
 1069|  2.15k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 74, False: 2.08k]
  ------------------
 1070|     74|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     74|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     74|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 26, False: 48]
  ------------------
 1072|   143k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 143k, False: 1]
  ------------------
 1073|   143k|        HoleEventData event_data;
 1074|   143k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 25, False: 143k]
  ------------------
 1075|     25|          return -1;
 1076|     25|        }
 1077|   143k|        hole_event_data_.push_back(event_data);
 1078|   143k|      }
 1079|       |
 1080|     26|    } else
 1081|     48|#endif
 1082|     48|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     48|      int last_symbol_id = 0;
 1085|  69.6k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 69.6k, False: 10]
  ------------------
 1086|  69.6k|        HoleEventData event_data;
 1087|  69.6k|        uint32_t delta;
 1088|  69.6k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 38, False: 69.5k]
  ------------------
 1089|     38|          return -1;
 1090|     38|        }
 1091|  69.5k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  69.5k|        last_symbol_id = event_data.symbol_id;
 1093|  69.5k|        hole_event_data_.push_back(event_data);
 1094|  69.5k|      }
 1095|     48|    }
 1096|     74|  }
 1097|  2.09k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.15k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.37k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.37k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.37k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  5.50k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 4.13k, False: 1.37k]
  ------------------
 1109|  4.13k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  4.13k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.14k, False: 2.98k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  2.28k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.14k, False: 1.14k]
  ------------------
 1114|  1.14k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.14k|      }
 1116|  1.14k|      continue;
 1117|  1.14k|    }
 1118|       |
 1119|  5.97k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 2.98k, False: 2.98k]
  ------------------
 1120|  2.98k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  2.98k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 2.42k, False: 567]
  ------------------
 1122|  2.42k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  2.42k|      }
 1124|  2.98k|    }
 1125|  2.98k|  }
 1126|  1.37k|  return true;
 1127|  1.37k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   278k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   278k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   278k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   278k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.11M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 836k, False: 278k]
  ------------------
 1139|   836k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   836k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 46.3k, False: 789k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   332k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 285k, False: 46.3k]
  ------------------
 1144|   285k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   285k|      }
 1146|  46.3k|      continue;
 1147|  46.3k|    }
 1148|   789k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   789k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 394k, False: 394k]
  ------------------
 1151|   394k|      continue;
 1152|   394k|    }
 1153|       |
 1154|  3.73M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 3.33M, False: 394k]
  ------------------
 1155|  3.33M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  3.33M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 3.09M, False: 243k]
  ------------------
 1157|  3.09M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  3.09M|      }
 1159|  3.33M|    }
 1160|   394k|  }
 1161|   278k|  return true;
 1162|   278k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  1.70k|    int num_connectivity_verts) {
 1167|       |  // Map between the existing and deduplicated point ids.
 1168|       |  // Note that at this point we have one point id for each corner of the
 1169|       |  // mesh so there is corner_table_->num_corners() point ids.
 1170|  1.70k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.70k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 60, False: 1.64k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  4.44k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 4.38k, False: 60]
  ------------------
 1176|  4.38k|      Mesh::Face face;
 1177|  4.38k|      const CornerIndex start_corner(3 * f.value());
 1178|  17.5k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 13.1k, False: 4.38k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  13.1k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  13.1k|        face[c] = vert_id;
 1182|  13.1k|      }
 1183|  4.38k|      decoder_->mesh()->SetFace(f, face);
 1184|  4.38k|    }
 1185|     60|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     60|    return true;
 1187|     60|  }
 1188|       |  // Else we need to deduplicate multiple attributes.
 1189|       |
 1190|       |  // Map between point id and an associated corner id. Only one corner for
 1191|       |  // each point is stored. The corners are used to sample the attribute values
 1192|       |  // in the last stage of the deduplication.
 1193|  1.64k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.64k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   187k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 185k, False: 1.63k]
  ------------------
 1197|   185k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   185k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 11.8k, False: 173k]
  ------------------
 1199|  11.8k|      continue;  // Isolated vertex.
 1200|  11.8k|    }
 1201|   173k|    CornerIndex deduplication_first_corner = c;
 1202|   173k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 47.4k, False: 126k]
  ------------------
 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.4k|      deduplication_first_corner = c;
 1206|   126k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   135k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 132k, False: 2.94k]
  ------------------
 1210|   132k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 4.51k, False: 127k]
  ------------------
 1211|  4.51k|          continue;  // No seam for this attribute, ignore it.
 1212|  4.51k|        }
 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|   127k|        const VertexIndex vert_id =
 1217|   127k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   127k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   127k|        bool seam_found = false;
 1220|   135k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 131k, False: 4.48k]
  ------------------
 1221|   131k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 5, False: 131k]
  ------------------
 1222|      5|            return false;
 1223|      5|          }
 1224|   131k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 123k, False: 7.58k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   123k|            deduplication_first_corner = act_c;
 1227|   123k|            seam_found = true;
 1228|   123k|            break;
 1229|   123k|          }
 1230|  7.58k|          act_c = corner_table_->SwingRight(act_c);
 1231|  7.58k|        }
 1232|   127k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 123k, False: 4.48k]
  ------------------
 1233|   123k|          break;  // No reason to process other attributes if we found a seam.
 1234|   123k|        }
 1235|   127k|      }
 1236|   126k|    }
 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|   173k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   173k|    corner_to_point_map[c.value()] =
 1246|   173k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   173k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   173k|    CornerIndex prev_c = c;
 1250|   173k|    c = corner_table_->SwingRight(c);
 1251|   888k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 840k, False: 47.6k]
  |  Branch (1251:40): [True: 714k, False: 126k]
  ------------------
 1252|   714k|      bool attribute_seam = false;
 1253|   755k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 740k, False: 14.9k]
  ------------------
 1254|   740k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 699k, False: 40.5k]
  ------------------
 1255|   740k|            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|   699k|          attribute_seam = true;
 1259|   699k|          break;
 1260|   699k|        }
 1261|   740k|      }
 1262|   714k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 699k, False: 14.9k]
  ------------------
 1263|   699k|        corner_to_point_map[c.value()] =
 1264|   699k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   699k|        point_to_corner_map.push_back(c.value());
 1266|   699k|      } else {
 1267|  14.9k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  14.9k|      }
 1269|   714k|      prev_c = c;
 1270|   714k|      c = corner_table_->SwingRight(c);
 1271|   714k|    }
 1272|   173k|  }
 1273|       |  // Add faces.
 1274|   281k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 279k, False: 1.63k]
  ------------------
 1275|   279k|    Mesh::Face face;
 1276|  1.11M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 839k, False: 279k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   839k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   839k|    }
 1280|   279k|    decoder_->mesh()->SetFace(f, face);
 1281|   279k|  }
 1282|  1.63k|  decoder_->point_cloud()->set_num_points(
 1283|  1.63k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.63k|  return true;
 1285|  1.64k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  2.32k|    : decoder_(nullptr),
   49|  2.32k|      last_symbol_id_(-1),
   50|  2.32k|      last_vert_id_(-1),
   51|  2.32k|      last_face_id_(-1),
   52|  2.32k|      num_new_vertices_(0),
   53|  2.32k|      num_encoded_vertices_(0),
   54|  2.32k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.32k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.32k|  decoder_ = decoder;
   60|  2.32k|  return true;
   61|  2.32k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  1.77k|    int att_id) const {
   67|  2.94k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 2.32k, False: 615]
  ------------------
   68|  2.32k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  2.32k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.16k, False: 1.16k]
  |  Branch (69:27): [True: 0, False: 1.16k]
  ------------------
   70|  1.16k|      continue;
   71|  1.16k|    }
   72|  1.16k|    const AttributesDecoderInterface *const dec =
   73|  1.16k|        decoder_->attributes_decoder(decoder_id);
   74|  2.17k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 2.17k, False: 0]
  ------------------
   75|  2.17k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.16k, False: 1.01k]
  ------------------
   76|  1.16k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 741, False: 421]
  ------------------
   77|    741|          return &attribute_data_[i].connectivity_data;
   78|    741|        }
   79|    421|        return nullptr;
   80|  1.16k|      }
   81|  2.17k|    }
   82|  1.16k|  }
   83|    615|  return nullptr;
   84|  1.77k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  1.77k|    int att_id) const {
   90|  2.94k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 2.32k, False: 615]
  ------------------
   91|  2.32k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  2.32k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.16k, False: 1.16k]
  |  Branch (92:27): [True: 0, False: 1.16k]
  ------------------
   93|  1.16k|      continue;
   94|  1.16k|    }
   95|  1.16k|    const AttributesDecoderInterface *const dec =
   96|  1.16k|        decoder_->attributes_decoder(decoder_id);
   97|  2.17k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 2.17k, False: 0]
  ------------------
   98|  2.17k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.16k, False: 1.01k]
  ------------------
   99|  1.16k|        return &attribute_data_[i].encoding_data;
  100|  1.16k|      }
  101|  2.17k|    }
  102|  1.16k|  }
  103|    615|  return &pos_encoding_data_;
  104|  1.77k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  1.52k|    int32_t att_decoder_id) {
  131|  1.52k|  int8_t att_data_id;
  132|  1.52k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 41, False: 1.48k]
  ------------------
  133|     41|    return false;
  134|     41|  }
  135|  1.48k|  uint8_t decoder_type;
  136|  1.48k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 21, False: 1.46k]
  ------------------
  137|     21|    return false;
  138|     21|  }
  139|       |
  140|  1.46k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.01k, False: 454]
  ------------------
  141|  1.01k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 29, False: 983]
  ------------------
  142|     29|      return false;  // Unexpected attribute data.
  143|     29|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|    983|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 4, False: 979]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|       |
  151|    979|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    979|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    454|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 453]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    453|    pos_data_decoder_id_ = att_decoder_id;
  158|    453|  }
  159|       |
  160|  1.43k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.43k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.43k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.43k, False: 0]
  ------------------
  162|  1.43k|    uint8_t traversal_method_encoded;
  163|  1.43k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 9, False: 1.42k]
  ------------------
  164|      9|      return false;
  165|      9|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.42k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 19, False: 1.40k]
  ------------------
  168|     19|      return false;
  169|     19|    }
  170|  1.40k|    traversal_method =
  171|  1.40k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.40k|  }
  173|       |
  174|  1.40k|  const Mesh *mesh = decoder_->mesh();
  175|  1.40k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.40k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 769, False: 635]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    769|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    769|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 430, False: 339]
  ------------------
  182|    430|      encoding_data = &pos_encoding_data_;
  183|    430|    } else {
  184|    339|      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|    339|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    339|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    769|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 180, False: 589]
  ------------------
  191|    180|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    180|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    180|          AttTraverser;
  194|    180|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    589|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 589, False: 0]
  ------------------
  196|    589|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    589|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    589|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    589|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    769|  } else {
  203|    635|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 5, False: 630]
  ------------------
  204|      5|      return false;  // Unsupported method.
  205|      5|    }
  206|    630|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 4, False: 626]
  ------------------
  207|      4|      return false;  // Attribute data must be specified.
  208|      4|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    626|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    626|        AttObserver;
  214|    626|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    626|        AttTraverser;
  216|       |
  217|    626|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    626|        &attribute_data_[att_data_id].encoding_data;
  219|    626|    const MeshAttributeCornerTable *const corner_table =
  220|    626|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    626|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    626|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    626|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    626|                             encoding_data);
  227|       |
  228|    626|    AttTraverser att_traverser;
  229|    626|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    626|    traversal_sequencer->SetTraverser(att_traverser);
  232|    626|    sequencer = std::move(traversal_sequencer);
  233|    626|  }
  234|       |
  235|  1.39k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.39k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.39k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.39k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.39k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.39k|                                        std::move(att_controller));
  244|  1.39k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  2.32k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.32k|  num_new_vertices_ = 0;
  249|  2.32k|  new_to_parent_vertex_map_.clear();
  250|  2.32k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.32k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.32k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 305, False: 2.02k]
  ------------------
  252|    305|    uint32_t num_new_verts;
  253|    305|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    305|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 198, False: 107]
  ------------------
  254|    198|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 7, False: 191]
  ------------------
  255|      7|        return false;
  256|      7|      }
  257|    198|    } else {
  258|    107|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 2, False: 105]
  ------------------
  259|      2|        return false;
  260|      2|      }
  261|    107|    }
  262|    296|    num_new_vertices_ = num_new_verts;
  263|    296|  }
  264|  2.32k|#endif
  265|       |
  266|  2.32k|  uint32_t num_encoded_vertices;
  267|  2.32k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.32k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.32k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 191, False: 2.12k]
  ------------------
  269|    191|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 3, False: 188]
  ------------------
  270|      3|      return false;
  271|      3|    }
  272|       |
  273|    191|  } else
  274|  2.12k|#endif
  275|  2.12k|  {
  276|  2.12k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 1, False: 2.12k]
  ------------------
  277|      1|      return false;
  278|      1|    }
  279|  2.12k|  }
  280|  2.31k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.31k|  uint32_t num_faces;
  283|  2.31k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.31k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.31k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 188, False: 2.12k]
  ------------------
  285|    188|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 3, False: 185]
  ------------------
  286|      3|      return false;
  287|      3|    }
  288|       |
  289|    188|  } else
  290|  2.12k|#endif
  291|  2.12k|  {
  292|  2.12k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 4, False: 2.12k]
  ------------------
  293|      4|      return false;
  294|      4|    }
  295|  2.12k|  }
  296|  2.30k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 6, False: 2.30k]
  ------------------
  297|      6|    return false;  // Draco cannot handle this many faces.
  298|      6|  }
  299|       |
  300|  2.30k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 23, False: 2.28k]
  ------------------
  301|     23|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     23|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.28k|  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.28k|  const uint64_t num_encoded_vertices_64 =
  311|  2.28k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.28k|  const uint64_t max_num_vertex_edges =
  313|  2.28k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.28k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 13, False: 2.26k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     13|    return false;
  317|     13|  }
  318|       |
  319|  2.26k|  uint8_t num_attribute_data;
  320|  2.26k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 27, False: 2.24k]
  ------------------
  321|     27|    return false;
  322|     27|  }
  323|       |
  324|  2.24k|  uint32_t num_encoded_symbols;
  325|  2.24k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.24k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.24k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 166, False: 2.07k]
  ------------------
  327|    166|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 13, False: 153]
  ------------------
  328|     13|      return false;
  329|     13|    }
  330|       |
  331|    166|  } else
  332|  2.07k|#endif
  333|  2.07k|  {
  334|  2.07k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 1, False: 2.07k]
  ------------------
  335|      1|      return false;
  336|      1|    }
  337|  2.07k|  }
  338|       |
  339|  2.22k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 18, False: 2.20k]
  ------------------
  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|     18|    return false;
  344|     18|  }
  345|  2.20k|  const uint32_t max_encoded_faces =
  346|  2.20k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.20k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 42, False: 2.16k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|     42|    return false;
  352|     42|  }
  353|       |
  354|  2.16k|  uint32_t num_encoded_split_symbols;
  355|  2.16k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.16k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.16k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 132, False: 2.03k]
  ------------------
  357|    132|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 3, False: 129]
  ------------------
  358|      3|      return false;
  359|      3|    }
  360|       |
  361|    132|  } else
  362|  2.03k|#endif
  363|  2.03k|  {
  364|  2.03k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 6, False: 2.02k]
  ------------------
  365|      6|      return false;
  366|      6|    }
  367|  2.03k|  }
  368|       |
  369|  2.15k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 28, False: 2.12k]
  ------------------
  370|     28|    return false;  // Split symbols are a sub-set of all symbols.
  371|     28|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.12k|  vertex_traversal_length_.clear();
  375|  2.12k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.12k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.12k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.12k|  processed_corner_ids_.clear();
  380|  2.12k|  processed_corner_ids_.reserve(num_faces);
  381|  2.12k|  processed_connectivity_corners_.clear();
  382|  2.12k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.12k|  topology_split_data_.clear();
  384|  2.12k|  hole_event_data_.clear();
  385|  2.12k|  init_face_configurations_.clear();
  386|  2.12k|  init_corners_.clear();
  387|       |
  388|  2.12k|  last_symbol_id_ = -1;
  389|  2.12k|  last_face_id_ = -1;
  390|  2.12k|  last_vert_id_ = -1;
  391|       |
  392|  2.12k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.12k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.12k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.12k]
  ------------------
  397|  2.12k|          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.12k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.12k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.12k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.12k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.12k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 225, False: 1.90k]
  ------------------
  411|    225|    uint32_t encoded_connectivity_size;
  412|    225|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    225|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 126, False: 99]
  ------------------
  413|    126|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 2, False: 124]
  ------------------
  414|      2|        return false;
  415|      2|      }
  416|    126|    } else {
  417|     99|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 2, False: 97]
  ------------------
  418|      2|        return false;
  419|      2|      }
  420|     99|    }
  421|    221|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 2, False: 219]
  ------------------
  422|    219|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 25, False: 194]
  ------------------
  423|     27|      return false;
  424|     27|    }
  425|    194|    DecoderBuffer event_buffer;
  426|    194|    event_buffer.Init(
  427|    194|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    194|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    194|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    194|    topology_split_decoded_bytes =
  432|    194|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    194|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 143, False: 51]
  ------------------
  434|    143|      return false;
  435|    143|    }
  436|       |
  437|    194|  } else
  438|  1.90k|#endif
  439|  1.90k|  {
  440|  1.90k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 83, False: 1.82k]
  ------------------
  441|     83|      return false;
  442|     83|    }
  443|  1.90k|  }
  444|       |
  445|  1.87k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.87k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.87k|                                           num_encoded_split_symbols);
  449|  1.87k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.87k|  DecoderBuffer traversal_end_buffer;
  452|  1.87k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 163, False: 1.70k]
  ------------------
  453|    163|    return false;
  454|    163|  }
  455|       |
  456|  1.70k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.70k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 133, False: 1.57k]
  ------------------
  458|    133|    return false;
  459|    133|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.57k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.57k|                           traversal_end_buffer.remaining_size(),
  464|  1.57k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.57k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.57k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.57k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 21, False: 1.55k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|     21|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|     21|  }
  471|  1.57k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.57k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.55k, False: 26]
  ------------------
  475|  1.55k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.55k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.55k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 21, False: 1.52k]
  ------------------
  477|  2.26k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 2.24k, False: 21]
  ------------------
  478|  2.24k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 2.24k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  2.24k|      }
  482|       |
  483|     21|    } else
  484|  1.52k|#endif
  485|  1.52k|    {
  486|  10.0M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 10.0M, False: 1.52k]
  ------------------
  487|  10.0M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 10.0M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  10.0M|      }
  491|  1.52k|    }
  492|  1.55k|  }
  493|  1.57k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  3.55k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 1.97k, False: 1.57k]
  ------------------
  498|  1.97k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  13.5M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 13.5M, False: 1.97k]
  ------------------
  501|  13.5M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  13.5M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  1.97k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 1.97k]
  ------------------
  505|  1.97k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  1.97k|  }
  509|       |
  510|  1.57k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  3.55k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 1.97k, False: 1.57k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  1.97k|    int32_t att_connectivity_verts =
  517|  1.97k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  1.97k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 169, False: 1.80k]
  ------------------
  519|    169|      att_connectivity_verts = corner_table_->num_vertices();
  520|    169|    }
  521|  1.97k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  1.97k|  }
  523|  1.57k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 12, False: 1.56k]
  ------------------
  524|     12|    return false;
  525|     12|  }
  526|  1.56k|  return true;
  527|  1.57k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    529|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    529|  return true;
  532|    529|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  1.70k|    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.70k|  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.70k|  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.70k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.70k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.70k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.70k|  int num_faces = 0;
  562|  50.5M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 50.5M, False: 1.63k]
  ------------------
  563|  50.5M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  50.5M|    bool check_topology_split = false;
  566|  50.5M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  50.5M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 25.1M, False: 25.4M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  25.1M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 25.1M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  25.1M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  25.1M|      const VertexIndex vertex_x =
  593|  25.1M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  25.1M|      const CornerIndex corner_b =
  595|  25.1M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  25.1M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 24, False: 25.1M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     24|        return -1;
  600|     24|      }
  601|  25.1M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 25.1M]
  |  Branch (601:11): [True: 0, False: 25.1M]
  ------------------
  602|  25.1M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 25.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|  25.1M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  25.1M|      SetOppositeCorners(corner_a, corner + 1);
  612|  25.1M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  25.1M|      const VertexIndex vert_a_prev =
  616|  25.1M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  25.1M|      const VertexIndex vert_b_next =
  618|  25.1M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  25.1M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 25.1M]
  |  Branch (619:38): [True: 0, False: 25.1M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  25.1M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  25.1M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  25.1M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  25.1M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  25.1M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  25.1M|      active_corner_stack.back() = corner;
  631|  25.4M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 25.3M, False: 27.5k]
  |  Branch (631:40): [True: 5.59k, False: 21.9k]
  ------------------
  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|  25.4M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 25.4M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  25.4M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  25.4M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 25.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|  25.4M|      const CornerIndex corner(3 * face.value());
  658|  25.4M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  25.4M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 25.3M, False: 5.59k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  25.3M|        opp_corner = corner + 2;
  662|  25.3M|        corner_l = corner + 1;
  663|  25.3M|        corner_r = corner;
  664|  25.3M|      } else {
  665|       |        // "l" is the new first corner.
  666|  5.59k|        opp_corner = corner + 1;
  667|  5.59k|        corner_l = corner;
  668|  5.59k|        corner_r = corner + 2;
  669|  5.59k|      }
  670|  25.4M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  25.4M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  25.4M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 11, False: 25.4M]
  ------------------
  675|     11|        return -1;  // Unexpected number of decoded vertices.
  676|     11|      }
  677|       |
  678|  25.4M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  25.4M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  25.4M|      const VertexIndex vertex_r =
  682|  25.4M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  25.4M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  25.4M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  25.4M|      corner_table_->MapCornerToVertex(
  688|  25.4M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  25.4M|      active_corner_stack.back() = corner;
  690|  25.4M|      check_topology_split = true;
  691|  25.4M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 7.32k, False: 14.6k]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  7.32k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 7.31k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  7.31k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  7.31k|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  7.31k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  7.31k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 28, False: 7.29k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     28|        active_corner_stack.push_back(it->second);
  714|     28|      }
  715|  7.31k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 7, False: 7.31k]
  ------------------
  716|      7|        return -1;
  717|      7|      }
  718|  7.31k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  7.31k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 7.31k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  7.31k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 6, False: 7.30k]
  |  Branch (724:11): [True: 6, False: 7.30k]
  ------------------
  725|  7.30k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 7.30k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      6|        return -1;
  729|      6|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  7.30k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  7.30k|      SetOppositeCorners(corner_a, corner + 2);
  735|  7.30k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  7.30k|      const VertexIndex vertex_p =
  739|  7.30k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  7.30k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  7.30k|      corner_table_->MapCornerToVertex(
  742|  7.30k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  7.30k|      const VertexIndex vert_b_prev =
  744|  7.30k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  7.30k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  7.30k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  7.30k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  7.30k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  7.30k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  7.30k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  7.30k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  7.30k|      const CornerIndex first_corner = corner_n;
  757|  31.3k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 24.0k, False: 7.30k]
  ------------------
  758|  24.0k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  24.0k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  24.0k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 24.0k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  24.0k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  7.30k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  7.30k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 2.93k, False: 4.37k]
  ------------------
  770|  2.93k|        invalid_vertices.push_back(vertex_n);
  771|  2.93k|      }
  772|  7.30k|      active_corner_stack.back() = corner;
  773|  14.6k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 14.6k, False: 0]
  ------------------
  774|  14.6k|      const CornerIndex corner(3 * face.value());
  775|  14.6k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  14.6k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  14.6k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  14.6k|                                       corner_table_->AddNewVertex());
  780|  14.6k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  14.6k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  14.6k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 14.6k]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  14.6k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  14.6k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  14.6k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  14.6k|      active_corner_stack.push_back(corner);
  792|  14.6k|      check_topology_split = true;
  793|  14.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|  50.5M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  50.5M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 25.4M, False: 25.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|  25.4M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  25.4M|      EdgeFaceName split_edge;
  812|  25.4M|      int encoder_split_symbol_id;
  813|  25.4M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.29k, False: 25.4M]
  ------------------
  814|  25.4M|                             &encoder_split_symbol_id)) {
  815|  1.29k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 21, False: 1.27k]
  ------------------
  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.27k|        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.27k|        CornerIndex new_active_corner;
  831|  1.27k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 439, False: 838]
  ------------------
  832|    439|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    838|        } else {
  834|    838|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    838|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.27k|        const int decoder_split_symbol_id =
  839|  1.27k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.27k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.27k|            new_active_corner;
  842|  1.27k|      }
  843|  25.4M|    }
  844|  50.5M|  }
  845|  1.63k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.63k]
  ------------------
  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|  7.02k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 5.41k, False: 1.61k]
  ------------------
  850|  5.41k|    const CornerIndex corner = active_corner_stack.back();
  851|  5.41k|    active_corner_stack.pop_back();
  852|  5.41k|    const bool interior_face =
  853|  5.41k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  5.41k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 3.10k, False: 2.31k]
  ------------------
  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|  3.10k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 6, False: 3.09k]
  ------------------
  877|      6|        return -1;  // More faces than expected added to the mesh.
  878|      6|      }
  879|       |
  880|  3.09k|      const CornerIndex corner_a = corner;
  881|  3.09k|      const VertexIndex vert_n =
  882|  3.09k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  3.09k|      const CornerIndex corner_b =
  884|  3.09k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  3.09k|      const VertexIndex vert_x =
  887|  3.09k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  3.09k|      const CornerIndex corner_c =
  889|  3.09k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  3.09k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 3.09k]
  |  Branch (891:33): [True: 7, False: 3.08k]
  |  Branch (891:55): [True: 0, False: 3.08k]
  ------------------
  892|       |        // All matched corners must be different.
  893|      9|        return -1;
  894|      9|      }
  895|  3.08k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 3.08k]
  |  Branch (895:11): [True: 1, False: 3.08k]
  ------------------
  896|  3.08k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 3.08k]
  ------------------
  897|  3.08k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 3.08k]
  ------------------
  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|  3.08k|      const VertexIndex vert_p =
  904|  3.08k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  3.08k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  3.08k|      const CornerIndex new_corner(3 * face.value());
  909|  3.08k|      SetOppositeCorners(new_corner, corner);
  910|  3.08k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  3.08k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  3.08k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  3.08k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  3.08k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  12.3k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 9.25k, False: 3.08k]
  ------------------
  920|  9.25k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  9.25k|      }
  922|       |
  923|  3.08k|      init_face_configurations_.push_back(true);
  924|  3.08k|      init_corners_.push_back(new_corner);
  925|  3.08k|    } 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.31k|      init_face_configurations_.push_back(false);
  930|  2.31k|      init_corners_.push_back(corner);
  931|  2.31k|    }
  932|  5.41k|  }
  933|  1.61k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 37, False: 1.58k]
  ------------------
  934|     37|    return -1;  // Unexpected number of decoded faces.
  935|     37|  }
  936|       |
  937|  1.58k|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  1.58k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 234, False: 1.57k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    234|    VertexIndex src_vert(num_vertices - 1);
  943|    281|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 47, False: 234]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     47|      src_vert = VertexIndex(--num_vertices - 1);
  946|     47|    }
  947|    234|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 47, False: 187]
  ------------------
  948|     47|      continue;  // No need to swap anything.
  949|     47|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    187|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|    938|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 755, False: 183]
  ------------------
  954|    755|      const CornerIndex cid = vcit.Corner();
  955|    755|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 4, False: 751]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      4|        return -1;
  959|      4|      }
  960|    751|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|    751|    }
  962|    183|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    183|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    183|    corner_table_->MakeVertexIsolated(src_vert);
  967|    183|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    183|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    183|    num_vertices--;
  972|    183|  }
  973|  1.57k|  return num_vertices;
  974|  1.58k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.09k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.09k|  uint32_t num_topology_splits;
  982|  2.09k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.09k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.09k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 104, False: 1.99k]
  ------------------
  984|    104|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 2, False: 102]
  ------------------
  985|      2|      return -1;
  986|      2|    }
  987|       |
  988|    104|  } else
  989|  1.99k|#endif
  990|  1.99k|  {
  991|  1.99k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 11, False: 1.98k]
  ------------------
  992|     11|      return -1;
  993|     11|    }
  994|  1.99k|  }
  995|  2.08k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 731, False: 1.35k]
  ------------------
  996|    731|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 55, False: 676]
  ------------------
  997|    731|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     55|      return -1;
  999|     55|    }
 1000|    676|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    676|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    676|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 62, False: 614]
  ------------------
 1002|  71.5k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 71.5k, False: 29]
  ------------------
 1003|  71.5k|        TopologySplitEventData event_data;
 1004|  71.5k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 19, False: 71.5k]
  ------------------
 1005|     19|          return -1;
 1006|     19|        }
 1007|  71.5k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 11, False: 71.4k]
  ------------------
 1008|     11|          return -1;
 1009|     11|        }
 1010|  71.4k|        uint8_t edge_data;
 1011|  71.4k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 71.4k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|  71.4k|        event_data.source_edge = edge_data & 1;
 1015|  71.4k|        topology_split_data_.push_back(event_data);
 1016|  71.4k|      }
 1017|       |
 1018|     62|    } else
 1019|    614|#endif
 1020|    614|    {
 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|    614|      int last_source_symbol_id = 0;
 1024|  3.97k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.40k, False: 574]
  ------------------
 1025|  3.40k|        TopologySplitEventData event_data;
 1026|  3.40k|        uint32_t delta;
 1027|  3.40k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 12, False: 3.39k]
  ------------------
 1028|     12|          return -1;
 1029|     12|        }
 1030|  3.39k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.39k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 12, False: 3.37k]
  ------------------
 1032|     12|          return -1;
 1033|     12|        }
 1034|  3.37k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 16, False: 3.36k]
  ------------------
 1035|     16|          return -1;
 1036|     16|        }
 1037|  3.36k|        event_data.split_symbol_id =
 1038|  3.36k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.36k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.36k|        topology_split_data_.push_back(event_data);
 1041|  3.36k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    574|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.34k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.76k, False: 574]
  ------------------
 1045|  2.76k|        uint32_t edge_data;
 1046|  2.76k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 440, False: 2.32k]
  ------------------
 1047|    440|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.32k|        } else {
 1049|  2.32k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.32k|        }
 1051|  2.76k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  2.76k|        event_data.source_edge = edge_data & 1;
 1053|  2.76k|      }
 1054|    574|      decoder_buffer->EndBitDecoding();
 1055|    574|    }
 1056|    676|  }
 1057|  1.95k|  uint32_t num_hole_events = 0;
 1058|  1.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  1.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 56, False: 1.90k]
  ------------------
 1060|     56|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 2, False: 54]
  ------------------
 1061|      2|      return -1;
 1062|      2|    }
 1063|  1.90k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.90k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 74, False: 1.82k]
  ------------------
 1064|     74|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 8, False: 66]
  ------------------
 1065|      8|      return -1;
 1066|      8|    }
 1067|     74|  }
 1068|  1.94k|#endif
 1069|  1.94k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 82, False: 1.86k]
  ------------------
 1070|     82|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     82|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     82|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 49, False: 33]
  ------------------
 1072|  49.0k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 49.0k, False: 1]
  ------------------
 1073|  49.0k|        HoleEventData event_data;
 1074|  49.0k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 48, False: 48.9k]
  ------------------
 1075|     48|          return -1;
 1076|     48|        }
 1077|  48.9k|        hole_event_data_.push_back(event_data);
 1078|  48.9k|      }
 1079|       |
 1080|     49|    } else
 1081|     33|#endif
 1082|     33|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     33|      int last_symbol_id = 0;
 1085|    560|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 554, False: 6]
  ------------------
 1086|    554|        HoleEventData event_data;
 1087|    554|        uint32_t delta;
 1088|    554|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 27, False: 527]
  ------------------
 1089|     27|          return -1;
 1090|     27|        }
 1091|    527|        event_data.symbol_id = delta + last_symbol_id;
 1092|    527|        last_symbol_id = event_data.symbol_id;
 1093|    527|        hole_event_data_.push_back(event_data);
 1094|    527|      }
 1095|     33|    }
 1096|     82|  }
 1097|  1.87k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  1.94k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  2.24k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  2.24k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  2.24k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  8.98k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 6.74k, False: 2.24k]
  ------------------
 1109|  6.74k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  6.74k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 865, False: 5.87k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  1.73k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 865, False: 865]
  ------------------
 1114|    865|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|    865|      }
 1116|    865|      continue;
 1117|    865|    }
 1118|       |
 1119|  11.7k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 5.87k, False: 5.87k]
  ------------------
 1120|  5.87k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  5.87k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 5.73k, False: 139]
  ------------------
 1122|  5.73k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  5.73k|      }
 1124|  5.87k|    }
 1125|  5.87k|  }
 1126|  2.24k|  return true;
 1127|  2.24k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  10.0M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  10.0M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  10.0M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  10.0M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  40.1M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 30.0M, False: 10.0M]
  ------------------
 1139|  30.0M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  30.0M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 135k, False: 29.9M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   275k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 140k, False: 135k]
  ------------------
 1144|   140k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   140k|      }
 1146|   135k|      continue;
 1147|   135k|    }
 1148|  29.9M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  29.9M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 14.9M, False: 14.9M]
  ------------------
 1151|  14.9M|      continue;
 1152|  14.9M|    }
 1153|       |
 1154|  30.2M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 15.3M, False: 14.9M]
  ------------------
 1155|  15.3M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  15.3M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 13.4M, False: 1.91M]
  ------------------
 1157|  13.4M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  13.4M|      }
 1159|  15.3M|    }
 1160|  14.9M|  }
 1161|  10.0M|  return true;
 1162|  10.0M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  1.57k|    int num_connectivity_verts) {
 1167|       |  // Map between the existing and deduplicated point ids.
 1168|       |  // Note that at this point we have one point id for each corner of the
 1169|       |  // mesh so there is corner_table_->num_corners() point ids.
 1170|  1.57k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.57k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 26, False: 1.55k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  2.46k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 2.43k, False: 26]
  ------------------
 1176|  2.43k|      Mesh::Face face;
 1177|  2.43k|      const CornerIndex start_corner(3 * f.value());
 1178|  9.73k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 7.30k, False: 2.43k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  7.30k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  7.30k|        face[c] = vert_id;
 1182|  7.30k|      }
 1183|  2.43k|      decoder_->mesh()->SetFace(f, face);
 1184|  2.43k|    }
 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|  1.55k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.55k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  5.08M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 5.08M, False: 1.53k]
  ------------------
 1197|  5.08M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  5.08M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 2.97k, False: 5.08M]
  ------------------
 1199|  2.97k|      continue;  // Isolated vertex.
 1200|  2.97k|    }
 1201|  5.08M|    CornerIndex deduplication_first_corner = c;
 1202|  5.08M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 135k, False: 4.94M]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|   135k|      deduplication_first_corner = c;
 1206|  4.94M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  5.51M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 4.94M, False: 571k]
  ------------------
 1210|  4.94M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 557k, False: 4.38M]
  ------------------
 1211|   557k|          continue;  // No seam for this attribute, ignore it.
 1212|   557k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|  4.38M|        const VertexIndex vert_id =
 1217|  4.38M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  4.38M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  4.38M|        bool seam_found = false;
 1220|  4.54M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 4.53M, False: 15.4k]
  ------------------
 1221|  4.53M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 12, False: 4.53M]
  ------------------
 1222|     12|            return false;
 1223|     12|          }
 1224|  4.53M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 4.37M, False: 157k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  4.37M|            deduplication_first_corner = act_c;
 1227|  4.37M|            seam_found = true;
 1228|  4.37M|            break;
 1229|  4.37M|          }
 1230|   157k|          act_c = corner_table_->SwingRight(act_c);
 1231|   157k|        }
 1232|  4.38M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 4.37M, False: 15.4k]
  ------------------
 1233|  4.37M|          break;  // No reason to process other attributes if we found a seam.
 1234|  4.37M|        }
 1235|  4.38M|      }
 1236|  4.94M|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|  5.08M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  5.08M|    corner_to_point_map[c.value()] =
 1246|  5.08M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  5.08M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  5.08M|    CornerIndex prev_c = c;
 1250|  5.08M|    c = corner_table_->SwingRight(c);
 1251|  30.0M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 29.9M, False: 137k]
  |  Branch (1251:40): [True: 24.9M, False: 4.94M]
  ------------------
 1252|  24.9M|      bool attribute_seam = false;
 1253|  27.9M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 24.9M, False: 2.98M]
  ------------------
 1254|  24.9M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 21.9M, False: 2.99M]
  ------------------
 1255|  24.9M|            attribute_data_[i].connectivity_data.Vertex(prev_c)) {
 1256|       |          // Attribute index changed from the previous corner. We need to add a
 1257|       |          // new point here.
 1258|  21.9M|          attribute_seam = true;
 1259|  21.9M|          break;
 1260|  21.9M|        }
 1261|  24.9M|      }
 1262|  24.9M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 21.9M, False: 2.98M]
  ------------------
 1263|  21.9M|        corner_to_point_map[c.value()] =
 1264|  21.9M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  21.9M|        point_to_corner_map.push_back(c.value());
 1266|  21.9M|      } else {
 1267|  2.98M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  2.98M|      }
 1269|  24.9M|      prev_c = c;
 1270|  24.9M|      c = corner_table_->SwingRight(c);
 1271|  24.9M|    }
 1272|  5.08M|  }
 1273|       |  // Add faces.
 1274|  9.93M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 9.93M, False: 1.53k]
  ------------------
 1275|  9.93M|    Mesh::Face face;
 1276|  39.7M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 29.8M, False: 9.93M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  29.8M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  29.8M|    }
 1280|  9.93M|    decoder_->mesh()->SetFace(f, face);
 1281|  9.93M|  }
 1282|  1.53k|  decoder_->point_cloud()->set_num_points(
 1283|  1.53k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.53k|  return true;
 1285|  1.55k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  2.30k|    : decoder_(nullptr),
   49|  2.30k|      last_symbol_id_(-1),
   50|  2.30k|      last_vert_id_(-1),
   51|  2.30k|      last_face_id_(-1),
   52|  2.30k|      num_new_vertices_(0),
   53|  2.30k|      num_encoded_vertices_(0),
   54|  2.30k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.30k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.30k|  decoder_ = decoder;
   60|  2.30k|  return true;
   61|  2.30k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    111|    int att_id) const {
   67|    186|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 142, False: 44]
  ------------------
   68|    142|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    142|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 75, False: 67]
  |  Branch (69:27): [True: 0, False: 67]
  ------------------
   70|     75|      continue;
   71|     75|    }
   72|     67|    const AttributesDecoderInterface *const dec =
   73|     67|        decoder_->attributes_decoder(decoder_id);
   74|    634|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 634, False: 0]
  ------------------
   75|    634|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 67, False: 567]
  ------------------
   76|     67|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 51, False: 16]
  ------------------
   77|     51|          return &attribute_data_[i].connectivity_data;
   78|     51|        }
   79|     16|        return nullptr;
   80|     67|      }
   81|    634|    }
   82|     67|  }
   83|     44|  return nullptr;
   84|    111|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    111|    int att_id) const {
   90|    186|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 142, False: 44]
  ------------------
   91|    142|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    142|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 75, False: 67]
  |  Branch (92:27): [True: 0, False: 67]
  ------------------
   93|     75|      continue;
   94|     75|    }
   95|     67|    const AttributesDecoderInterface *const dec =
   96|     67|        decoder_->attributes_decoder(decoder_id);
   97|    634|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 634, False: 0]
  ------------------
   98|    634|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 67, False: 567]
  ------------------
   99|     67|        return &attribute_data_[i].encoding_data;
  100|     67|      }
  101|    634|    }
  102|     67|  }
  103|     44|  return &pos_encoding_data_;
  104|    111|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    144|    int32_t att_decoder_id) {
  131|    144|  int8_t att_data_id;
  132|    144|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 5, False: 139]
  ------------------
  133|      5|    return false;
  134|      5|  }
  135|    139|  uint8_t decoder_type;
  136|    139|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 6, False: 133]
  ------------------
  137|      6|    return false;
  138|      6|  }
  139|       |
  140|    133|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 83, False: 50]
  ------------------
  141|     83|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 17, False: 66]
  ------------------
  142|     17|      return false;  // Unexpected attribute data.
  143|     17|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|     66|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 3, False: 63]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|       |
  151|     63|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|     63|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|     50|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 48]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|     48|    pos_data_decoder_id_ = att_decoder_id;
  158|     48|  }
  159|       |
  160|    111|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    111|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    111|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 111, False: 0]
  ------------------
  162|    111|    uint8_t traversal_method_encoded;
  163|    111|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 4, False: 107]
  ------------------
  164|      4|      return false;
  165|      4|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    107|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 14, False: 93]
  ------------------
  168|     14|      return false;
  169|     14|    }
  170|     93|    traversal_method =
  171|     93|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|     93|  }
  173|       |
  174|     93|  const Mesh *mesh = decoder_->mesh();
  175|     93|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|     93|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 42, False: 51]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|     42|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|     42|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 30, False: 12]
  ------------------
  182|     30|      encoding_data = &pos_encoding_data_;
  183|     30|    } else {
  184|     12|      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|     12|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     12|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|     42|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 24, False: 18]
  ------------------
  191|     24|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     24|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     24|          AttTraverser;
  194|     24|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|     24|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 18, False: 0]
  ------------------
  196|     18|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|     18|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|     18|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|     18|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|     51|  } else {
  203|     51|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 6, False: 45]
  ------------------
  204|      6|      return false;  // Unsupported method.
  205|      6|    }
  206|     45|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 43]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     43|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     43|        AttObserver;
  214|     43|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     43|        AttTraverser;
  216|       |
  217|     43|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     43|        &attribute_data_[att_data_id].encoding_data;
  219|     43|    const MeshAttributeCornerTable *const corner_table =
  220|     43|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     43|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     43|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     43|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     43|                             encoding_data);
  227|       |
  228|     43|    AttTraverser att_traverser;
  229|     43|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     43|    traversal_sequencer->SetTraverser(att_traverser);
  232|     43|    sequencer = std::move(traversal_sequencer);
  233|     43|  }
  234|       |
  235|     85|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 85]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|     85|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|     85|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|     85|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|     85|                                        std::move(att_controller));
  244|     85|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  2.30k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.30k|  num_new_vertices_ = 0;
  249|  2.30k|  new_to_parent_vertex_map_.clear();
  250|  2.30k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.30k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.30k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 351, False: 1.95k]
  ------------------
  252|    351|    uint32_t num_new_verts;
  253|    351|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    351|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 191, False: 160]
  ------------------
  254|    191|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 7, False: 184]
  ------------------
  255|      7|        return false;
  256|      7|      }
  257|    191|    } else {
  258|    160|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 1, False: 159]
  ------------------
  259|      1|        return false;
  260|      1|      }
  261|    160|    }
  262|    343|    num_new_vertices_ = num_new_verts;
  263|    343|  }
  264|  2.29k|#endif
  265|       |
  266|  2.29k|  uint32_t num_encoded_vertices;
  267|  2.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.29k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 184, False: 2.11k]
  ------------------
  269|    184|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 2, False: 182]
  ------------------
  270|      2|      return false;
  271|      2|    }
  272|       |
  273|    184|  } else
  274|  2.11k|#endif
  275|  2.11k|  {
  276|  2.11k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 4, False: 2.11k]
  ------------------
  277|      4|      return false;
  278|      4|    }
  279|  2.11k|  }
  280|  2.29k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.29k|  uint32_t num_faces;
  283|  2.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.29k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 182, False: 2.11k]
  ------------------
  285|    182|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 1, False: 181]
  ------------------
  286|      1|      return false;
  287|      1|    }
  288|       |
  289|    182|  } else
  290|  2.11k|#endif
  291|  2.11k|  {
  292|  2.11k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 4, False: 2.10k]
  ------------------
  293|      4|      return false;
  294|      4|    }
  295|  2.11k|  }
  296|  2.28k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 2, False: 2.28k]
  ------------------
  297|      2|    return false;  // Draco cannot handle this many faces.
  298|      2|  }
  299|       |
  300|  2.28k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 23, False: 2.26k]
  ------------------
  301|     23|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     23|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.26k|  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.26k|  const uint64_t num_encoded_vertices_64 =
  311|  2.26k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.26k|  const uint64_t max_num_vertex_edges =
  313|  2.26k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.26k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 11, False: 2.25k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     11|    return false;
  317|     11|  }
  318|       |
  319|  2.25k|  uint8_t num_attribute_data;
  320|  2.25k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 21, False: 2.23k]
  ------------------
  321|     21|    return false;
  322|     21|  }
  323|       |
  324|  2.23k|  uint32_t num_encoded_symbols;
  325|  2.23k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.23k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.23k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 174, False: 2.05k]
  ------------------
  327|    174|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 9, False: 165]
  ------------------
  328|      9|      return false;
  329|      9|    }
  330|       |
  331|    174|  } else
  332|  2.05k|#endif
  333|  2.05k|  {
  334|  2.05k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 6, False: 2.05k]
  ------------------
  335|      6|      return false;
  336|      6|    }
  337|  2.05k|  }
  338|       |
  339|  2.21k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 12, False: 2.20k]
  ------------------
  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.20k|  const uint32_t max_encoded_faces =
  346|  2.20k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.20k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 39, False: 2.16k]
  ------------------
  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|     39|    return false;
  352|     39|  }
  353|       |
  354|  2.16k|  uint32_t num_encoded_split_symbols;
  355|  2.16k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.16k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.16k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 151, False: 2.01k]
  ------------------
  357|    151|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 2, False: 149]
  ------------------
  358|      2|      return false;
  359|      2|    }
  360|       |
  361|    151|  } else
  362|  2.01k|#endif
  363|  2.01k|  {
  364|  2.01k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 5, False: 2.00k]
  ------------------
  365|      5|      return false;
  366|      5|    }
  367|  2.01k|  }
  368|       |
  369|  2.15k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 19, False: 2.13k]
  ------------------
  370|     19|    return false;  // Split symbols are a sub-set of all symbols.
  371|     19|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.13k|  vertex_traversal_length_.clear();
  375|  2.13k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.13k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.13k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.13k|  processed_corner_ids_.clear();
  380|  2.13k|  processed_corner_ids_.reserve(num_faces);
  381|  2.13k|  processed_connectivity_corners_.clear();
  382|  2.13k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.13k|  topology_split_data_.clear();
  384|  2.13k|  hole_event_data_.clear();
  385|  2.13k|  init_face_configurations_.clear();
  386|  2.13k|  init_corners_.clear();
  387|       |
  388|  2.13k|  last_symbol_id_ = -1;
  389|  2.13k|  last_face_id_ = -1;
  390|  2.13k|  last_vert_id_ = -1;
  391|       |
  392|  2.13k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.13k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.13k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.13k]
  ------------------
  397|  2.13k|          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.13k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.13k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.13k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.13k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.13k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 296, False: 1.84k]
  ------------------
  411|    296|    uint32_t encoded_connectivity_size;
  412|    296|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    296|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 148, False: 148]
  ------------------
  413|    148|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 4, False: 144]
  ------------------
  414|      4|        return false;
  415|      4|      }
  416|    148|    } else {
  417|    148|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 1, False: 147]
  ------------------
  418|      1|        return false;
  419|      1|      }
  420|    148|    }
  421|    291|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 290]
  ------------------
  422|    290|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 18, False: 272]
  ------------------
  423|     19|      return false;
  424|     19|    }
  425|    272|    DecoderBuffer event_buffer;
  426|    272|    event_buffer.Init(
  427|    272|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    272|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    272|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    272|    topology_split_decoded_bytes =
  432|    272|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    272|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 98, False: 174]
  ------------------
  434|     98|      return false;
  435|     98|    }
  436|       |
  437|    272|  } else
  438|  1.84k|#endif
  439|  1.84k|  {
  440|  1.84k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 81, False: 1.76k]
  ------------------
  441|     81|      return false;
  442|     81|    }
  443|  1.84k|  }
  444|       |
  445|  1.93k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.93k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.93k|                                           num_encoded_split_symbols);
  449|  1.93k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.93k|  DecoderBuffer traversal_end_buffer;
  452|  1.93k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 1.04k, False: 893]
  ------------------
  453|  1.04k|    return false;
  454|  1.04k|  }
  455|       |
  456|    893|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|    893|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 739, False: 154]
  ------------------
  458|    739|    return false;
  459|    739|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    154|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    154|                           traversal_end_buffer.remaining_size(),
  464|    154|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    154|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    154|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    154|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 5, False: 149]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      5|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      5|  }
  471|    154|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    154|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 133, False: 21]
  ------------------
  475|    133|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    133|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    133|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 4, False: 129]
  ------------------
  477|     12|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 8, False: 4]
  ------------------
  478|      8|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 8]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|      8|      }
  482|       |
  483|      4|    } else
  484|    129|#endif
  485|    129|    {
  486|   294k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 294k, False: 129]
  ------------------
  487|   294k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 294k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   294k|      }
  491|    129|    }
  492|    133|  }
  493|    154|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    376|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 222, False: 154]
  ------------------
  498|    222|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   338k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 338k, False: 222]
  ------------------
  501|   338k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   338k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    222|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 222]
  ------------------
  505|    222|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    222|  }
  509|       |
  510|    154|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    376|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 222, False: 154]
  ------------------
  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|    222|    int32_t att_connectivity_verts =
  517|    222|        attribute_data_[i].connectivity_data.num_vertices();
  518|    222|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 1, False: 221]
  ------------------
  519|      1|      att_connectivity_verts = corner_table_->num_vertices();
  520|      1|    }
  521|    222|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    222|  }
  523|    154|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 14, False: 140]
  ------------------
  524|     14|    return false;
  525|     14|  }
  526|    140|  return true;
  527|    154|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     13|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     13|  return true;
  532|     13|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|    893|    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|    893|  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|    893|  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|    893|  std::vector<VertexIndex> invalid_vertices;
  558|    893|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|    893|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|    893|  int num_faces = 0;
  562|  40.3M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 40.3M, False: 249]
  ------------------
  563|  40.3M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  40.3M|    bool check_topology_split = false;
  566|  40.3M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  40.3M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 3.70M, False: 36.6M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  3.70M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 39, False: 3.70M]
  ------------------
  588|     39|        return -1;
  589|     39|      }
  590|       |
  591|  3.70M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  3.70M|      const VertexIndex vertex_x =
  593|  3.70M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  3.70M|      const CornerIndex corner_b =
  595|  3.70M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  3.70M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 291, False: 3.70M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    291|        return -1;
  600|    291|      }
  601|  3.70M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 3.70M]
  |  Branch (601:11): [True: 0, False: 3.70M]
  ------------------
  602|  3.70M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 3.70M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  3.70M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  3.70M|      SetOppositeCorners(corner_a, corner + 1);
  612|  3.70M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  3.70M|      const VertexIndex vert_a_prev =
  616|  3.70M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  3.70M|      const VertexIndex vert_b_next =
  618|  3.70M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  3.70M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 3.70M]
  |  Branch (619:38): [True: 0, False: 3.70M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  3.70M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  3.70M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  3.70M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  3.70M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  3.70M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  3.70M|      active_corner_stack.back() = corner;
  631|  36.6M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 1.87k, False: 36.6M]
  |  Branch (631:40): [True: 32.4M, False: 4.13M]
  ------------------
  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|  32.4M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 32.4M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  32.4M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  32.4M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 32.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|  32.4M|      const CornerIndex corner(3 * face.value());
  658|  32.4M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  32.4M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 1.87k, False: 32.4M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  1.87k|        opp_corner = corner + 2;
  662|  1.87k|        corner_l = corner + 1;
  663|  1.87k|        corner_r = corner;
  664|  32.4M|      } else {
  665|       |        // "l" is the new first corner.
  666|  32.4M|        opp_corner = corner + 1;
  667|  32.4M|        corner_l = corner;
  668|  32.4M|        corner_r = corner + 2;
  669|  32.4M|      }
  670|  32.4M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  32.4M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  32.4M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 7, False: 32.4M]
  ------------------
  675|      7|        return -1;  // Unexpected number of decoded vertices.
  676|      7|      }
  677|       |
  678|  32.4M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  32.4M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  32.4M|      const VertexIndex vertex_r =
  682|  32.4M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  32.4M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  32.4M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  32.4M|      corner_table_->MapCornerToVertex(
  688|  32.4M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  32.4M|      active_corner_stack.back() = corner;
  690|  32.4M|      check_topology_split = true;
  691|  32.4M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 35.9k, False: 4.10M]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  35.9k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 35.9k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  35.9k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  35.9k|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  35.9k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  35.9k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 23, False: 35.9k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     23|        active_corner_stack.push_back(it->second);
  714|     23|      }
  715|  35.9k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 70, False: 35.8k]
  ------------------
  716|     70|        return -1;
  717|     70|      }
  718|  35.8k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  35.8k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 35.8k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  35.8k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 4, False: 35.8k]
  |  Branch (724:11): [True: 4, False: 35.8k]
  ------------------
  725|  35.8k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 35.8k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      4|        return -1;
  729|      4|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  35.8k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  35.8k|      SetOppositeCorners(corner_a, corner + 2);
  735|  35.8k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  35.8k|      const VertexIndex vertex_p =
  739|  35.8k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  35.8k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  35.8k|      corner_table_->MapCornerToVertex(
  742|  35.8k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  35.8k|      const VertexIndex vert_b_prev =
  744|  35.8k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  35.8k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  35.8k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  35.8k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  35.8k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  35.8k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  35.8k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  35.8k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  35.8k|      const CornerIndex first_corner = corner_n;
  757|  10.3M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 10.2M, False: 35.8k]
  ------------------
  758|  10.2M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  10.2M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  10.2M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 10.2M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  10.2M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  35.8k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  35.8k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 35.8k, False: 55]
  ------------------
  770|  35.8k|        invalid_vertices.push_back(vertex_n);
  771|  35.8k|      }
  772|  35.8k|      active_corner_stack.back() = corner;
  773|  4.10M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 4.10M, False: 187]
  ------------------
  774|  4.10M|      const CornerIndex corner(3 * face.value());
  775|  4.10M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  4.10M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  4.10M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  4.10M|                                       corner_table_->AddNewVertex());
  780|  4.10M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  4.10M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  4.10M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 16, False: 4.10M]
  ------------------
  784|     16|        return -1;  // Unexpected number of decoded vertices.
  785|     16|      }
  786|       |
  787|  4.10M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  4.10M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  4.10M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  4.10M|      active_corner_stack.push_back(corner);
  792|  4.10M|      check_topology_split = true;
  793|  4.10M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    187|      return -1;
  796|    187|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  40.3M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  40.3M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 36.5M, False: 3.74M]
  ------------------
  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|  36.5M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  36.5M|      EdgeFaceName split_edge;
  812|  36.5M|      int encoder_split_symbol_id;
  813|  36.5M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.20k, False: 36.5M]
  ------------------
  814|  36.5M|                             &encoder_split_symbol_id)) {
  815|  1.20k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 28, False: 1.17k]
  ------------------
  816|     28|          return -1;  // Wrong split symbol id.
  817|     28|        }
  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.17k|        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.17k|        CornerIndex new_active_corner;
  831|  1.17k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 452, False: 727]
  ------------------
  832|    452|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    727|        } else {
  834|    727|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    727|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.17k|        const int decoder_split_symbol_id =
  839|  1.17k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.17k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.17k|            new_active_corner;
  842|  1.17k|      }
  843|  36.5M|    }
  844|  40.3M|  }
  845|    249|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 249]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  2.34M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 2.34M, False: 218]
  ------------------
  850|  2.34M|    const CornerIndex corner = active_corner_stack.back();
  851|  2.34M|    active_corner_stack.pop_back();
  852|  2.34M|    const bool interior_face =
  853|  2.34M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  2.34M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 2.31M, False: 28.3k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  2.31M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 27, False: 2.31M]
  ------------------
  877|     27|        return -1;  // More faces than expected added to the mesh.
  878|     27|      }
  879|       |
  880|  2.31M|      const CornerIndex corner_a = corner;
  881|  2.31M|      const VertexIndex vert_n =
  882|  2.31M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  2.31M|      const CornerIndex corner_b =
  884|  2.31M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  2.31M|      const VertexIndex vert_x =
  887|  2.31M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  2.31M|      const CornerIndex corner_c =
  889|  2.31M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  2.31M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 2.31M]
  |  Branch (891:33): [True: 2, False: 2.31M]
  |  Branch (891:55): [True: 0, False: 2.31M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      4|        return -1;
  894|      4|      }
  895|  2.31M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 2.31M]
  |  Branch (895:11): [True: 0, False: 2.31M]
  ------------------
  896|  2.31M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 2.31M]
  ------------------
  897|  2.31M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 2.31M]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      0|        return -1;
  901|      0|      }
  902|       |
  903|  2.31M|      const VertexIndex vert_p =
  904|  2.31M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  2.31M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  2.31M|      const CornerIndex new_corner(3 * face.value());
  909|  2.31M|      SetOppositeCorners(new_corner, corner);
  910|  2.31M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  2.31M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  2.31M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  2.31M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  2.31M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  9.27M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 6.95M, False: 2.31M]
  ------------------
  920|  6.95M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  6.95M|      }
  922|       |
  923|  2.31M|      init_face_configurations_.push_back(true);
  924|  2.31M|      init_corners_.push_back(new_corner);
  925|  2.31M|    } 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|  28.3k|      init_face_configurations_.push_back(false);
  930|  28.3k|      init_corners_.push_back(corner);
  931|  28.3k|    }
  932|  2.34M|  }
  933|    218|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 61, False: 157]
  ------------------
  934|     61|    return -1;  // Unexpected number of decoded faces.
  935|     61|  }
  936|       |
  937|    157|  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.48k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 2.48k, False: 154]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  2.48k|    VertexIndex src_vert(num_vertices - 1);
  943|  3.06k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 573, False: 2.48k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    573|      src_vert = VertexIndex(--num_vertices - 1);
  946|    573|    }
  947|  2.48k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 440, False: 2.04k]
  ------------------
  948|    440|      continue;  // No need to swap anything.
  949|    440|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.04k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  8.14k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 6.09k, False: 2.04k]
  ------------------
  954|  6.09k|      const CornerIndex cid = vcit.Corner();
  955|  6.09k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 3, False: 6.09k]
  ------------------
  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.09k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  6.09k|    }
  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|    154|  return num_vertices;
  974|    157|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.11k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.11k|  uint32_t num_topology_splits;
  982|  2.11k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.11k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.11k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 129, False: 1.98k]
  ------------------
  984|    129|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 128]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    129|  } else
  989|  1.98k|#endif
  990|  1.98k|  {
  991|  1.98k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 9, False: 1.97k]
  ------------------
  992|      9|      return -1;
  993|      9|    }
  994|  1.98k|  }
  995|  2.10k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 496, False: 1.60k]
  ------------------
  996|    496|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 37, False: 459]
  ------------------
  997|    496|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     37|      return -1;
  999|     37|    }
 1000|    459|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    459|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    459|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 44, False: 415]
  ------------------
 1002|   121k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 121k, False: 15]
  ------------------
 1003|   121k|        TopologySplitEventData event_data;
 1004|   121k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 18, False: 121k]
  ------------------
 1005|     18|          return -1;
 1006|     18|        }
 1007|   121k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 8, False: 121k]
  ------------------
 1008|      8|          return -1;
 1009|      8|        }
 1010|   121k|        uint8_t edge_data;
 1011|   121k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 121k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|   121k|        event_data.source_edge = edge_data & 1;
 1015|   121k|        topology_split_data_.push_back(event_data);
 1016|   121k|      }
 1017|       |
 1018|     44|    } else
 1019|    415|#endif
 1020|    415|    {
 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|    415|      int last_source_symbol_id = 0;
 1024|  3.30k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 2.93k, False: 363]
  ------------------
 1025|  2.93k|        TopologySplitEventData event_data;
 1026|  2.93k|        uint32_t delta;
 1027|  2.93k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 21, False: 2.91k]
  ------------------
 1028|     21|          return -1;
 1029|     21|        }
 1030|  2.91k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  2.91k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 7, False: 2.91k]
  ------------------
 1032|      7|          return -1;
 1033|      7|        }
 1034|  2.91k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 24, False: 2.88k]
  ------------------
 1035|     24|          return -1;
 1036|     24|        }
 1037|  2.88k|        event_data.split_symbol_id =
 1038|  2.88k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  2.88k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  2.88k|        topology_split_data_.push_back(event_data);
 1041|  2.88k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    363|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  2.82k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.45k, False: 363]
  ------------------
 1045|  2.45k|        uint32_t edge_data;
 1046|  2.45k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.45k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 189, False: 2.26k]
  ------------------
 1047|    189|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.26k|        } else {
 1049|  2.26k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.26k|        }
 1051|  2.45k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  2.45k|        event_data.source_edge = edge_data & 1;
 1053|  2.45k|      }
 1054|    363|      decoder_buffer->EndBitDecoding();
 1055|    363|    }
 1056|    459|  }
 1057|  1.98k|  uint32_t num_hole_events = 0;
 1058|  1.98k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  1.98k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.98k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 87, False: 1.89k]
  ------------------
 1060|     87|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 1, False: 86]
  ------------------
 1061|      1|      return -1;
 1062|      1|    }
 1063|  1.89k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.89k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 136, False: 1.76k]
  ------------------
 1064|    136|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 11, False: 125]
  ------------------
 1065|     11|      return -1;
 1066|     11|    }
 1067|    136|  }
 1068|  1.97k|#endif
 1069|  1.97k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 64, False: 1.91k]
  ------------------
 1070|     64|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     64|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     64|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 28, False: 36]
  ------------------
 1072|   422k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 422k, False: 1]
  ------------------
 1073|   422k|        HoleEventData event_data;
 1074|   422k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 27, False: 422k]
  ------------------
 1075|     27|          return -1;
 1076|     27|        }
 1077|   422k|        hole_event_data_.push_back(event_data);
 1078|   422k|      }
 1079|       |
 1080|     28|    } else
 1081|     36|#endif
 1082|     36|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     36|      int last_symbol_id = 0;
 1085|  92.5k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 92.5k, False: 24]
  ------------------
 1086|  92.5k|        HoleEventData event_data;
 1087|  92.5k|        uint32_t delta;
 1088|  92.5k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 12, False: 92.5k]
  ------------------
 1089|     12|          return -1;
 1090|     12|        }
 1091|  92.5k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  92.5k|        last_symbol_id = event_data.symbol_id;
 1093|  92.5k|        hole_event_data_.push_back(event_data);
 1094|  92.5k|      }
 1095|     36|    }
 1096|     64|  }
 1097|  1.93k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  1.97k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|      8|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|      8|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|      8|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     32|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 24, False: 8]
  ------------------
 1109|     24|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     24|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 8, False: 16]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     16|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 8, False: 8]
  ------------------
 1114|      8|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|      8|      }
 1116|      8|      continue;
 1117|      8|    }
 1118|       |
 1119|     32|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 16, False: 16]
  ------------------
 1120|     16|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     16|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 6, False: 10]
  ------------------
 1122|      6|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|      6|      }
 1124|     16|    }
 1125|     16|  }
 1126|      8|  return true;
 1127|      8|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   294k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   294k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   294k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   294k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.17M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 883k, False: 294k]
  ------------------
 1139|   883k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   883k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 172k, False: 711k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   344k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 172k, False: 172k]
  ------------------
 1144|   172k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   172k|      }
 1146|   172k|      continue;
 1147|   172k|    }
 1148|   711k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   711k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 355k, False: 355k]
  ------------------
 1151|   355k|      continue;
 1152|   355k|    }
 1153|       |
 1154|   711k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 355k, False: 355k]
  ------------------
 1155|   355k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   355k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 166k, False: 189k]
  ------------------
 1157|   166k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   166k|      }
 1159|   355k|    }
 1160|   355k|  }
 1161|   294k|  return true;
 1162|   294k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    154|    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|    154|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    154|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 21, False: 133]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  80.7k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 80.7k, False: 21]
  ------------------
 1176|  80.7k|      Mesh::Face face;
 1177|  80.7k|      const CornerIndex start_corner(3 * f.value());
 1178|   323k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 242k, False: 80.7k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   242k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   242k|        face[c] = vert_id;
 1182|   242k|      }
 1183|  80.7k|      decoder_->mesh()->SetFace(f, face);
 1184|  80.7k|    }
 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|    133|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    133|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   236k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 236k, False: 119]
  ------------------
 1197|   236k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   236k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 50, False: 236k]
  ------------------
 1199|     50|      continue;  // Isolated vertex.
 1200|     50|    }
 1201|   236k|    CornerIndex deduplication_first_corner = c;
 1202|   236k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 171k, False: 64.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|   171k|      deduplication_first_corner = c;
 1206|   171k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  72.6k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 65.0k, False: 7.68k]
  ------------------
 1210|  65.0k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 7.54k, False: 57.4k]
  ------------------
 1211|  7.54k|          continue;  // No seam for this attribute, ignore it.
 1212|  7.54k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|  57.4k|        const VertexIndex vert_id =
 1217|  57.4k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  57.4k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  57.4k|        bool seam_found = false;
 1220|  60.7k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 60.5k, False: 189]
  ------------------
 1221|  60.5k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 14, False: 60.5k]
  ------------------
 1222|     14|            return false;
 1223|     14|          }
 1224|  60.5k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 57.2k, False: 3.31k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  57.2k|            deduplication_first_corner = act_c;
 1227|  57.2k|            seam_found = true;
 1228|  57.2k|            break;
 1229|  57.2k|          }
 1230|  3.31k|          act_c = corner_table_->SwingRight(act_c);
 1231|  3.31k|        }
 1232|  57.4k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 57.2k, False: 189]
  ------------------
 1233|  57.2k|          break;  // No reason to process other attributes if we found a seam.
 1234|  57.2k|        }
 1235|  57.4k|      }
 1236|  64.9k|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|   236k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   236k|    corner_to_point_map[c.value()] =
 1246|   236k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   236k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   236k|    CornerIndex prev_c = c;
 1250|   236k|    c = corner_table_->SwingRight(c);
 1251|   811k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 640k, False: 171k]
  |  Branch (1251:40): [True: 575k, False: 64.5k]
  ------------------
 1252|   575k|      bool attribute_seam = false;
 1253|  1.05M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 575k, False: 475k]
  ------------------
 1254|   575k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 100k, False: 475k]
  ------------------
 1255|   575k|            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|   100k|          attribute_seam = true;
 1259|   100k|          break;
 1260|   100k|        }
 1261|   575k|      }
 1262|   575k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 100k, False: 475k]
  ------------------
 1263|   100k|        corner_to_point_map[c.value()] =
 1264|   100k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   100k|        point_to_corner_map.push_back(c.value());
 1266|   475k|      } else {
 1267|   475k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   475k|      }
 1269|   575k|      prev_c = c;
 1270|   575k|      c = corner_table_->SwingRight(c);
 1271|   575k|    }
 1272|   236k|  }
 1273|       |  // Add faces.
 1274|  93.8k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 93.6k, False: 119]
  ------------------
 1275|  93.6k|    Mesh::Face face;
 1276|   374k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 281k, False: 93.6k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   281k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   281k|    }
 1280|  93.6k|    decoder_->mesh()->SetFace(f, face);
 1281|  93.6k|  }
 1282|    119|  decoder_->point_cloud()->set_num_points(
 1283|    119|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    119|  return true;
 1285|    133|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    135|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    135|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    135|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    135|  const Mesh *mesh = decoder_->mesh();
  115|    135|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    135|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    135|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    135|                           encoding_data);
  120|       |
  121|    135|  TraverserT att_traverser;
  122|    135|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    135|  traversal_sequencer->SetTraverser(att_traverser);
  125|    135|  return std::move(traversal_sequencer);
  126|    135|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    617|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    617|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    617|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    617|  const Mesh *mesh = decoder_->mesh();
  115|    617|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    617|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    617|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    617|                           encoding_data);
  120|       |
  121|    617|  TraverserT att_traverser;
  122|    617|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    617|  traversal_sequencer->SetTraverser(att_traverser);
  125|    617|  return std::move(traversal_sequencer);
  126|    617|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    180|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    180|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    180|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    180|  const Mesh *mesh = decoder_->mesh();
  115|    180|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    180|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    180|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    180|                           encoding_data);
  120|       |
  121|    180|  TraverserT att_traverser;
  122|    180|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    180|  traversal_sequencer->SetTraverser(att_traverser);
  125|    180|  return std::move(traversal_sequencer);
  126|    180|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    589|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    589|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    589|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    589|  const Mesh *mesh = decoder_->mesh();
  115|    589|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    589|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    589|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    589|                           encoding_data);
  120|       |
  121|    589|  TraverserT att_traverser;
  122|    589|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    589|  traversal_sequencer->SetTraverser(att_traverser);
  125|    589|  return std::move(traversal_sequencer);
  126|    589|}
_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|     18|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     18|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     18|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     18|  const Mesh *mesh = decoder_->mesh();
  115|     18|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     18|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     18|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     18|                           encoding_data);
  120|       |
  121|     18|  TraverserT att_traverser;
  122|     18|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     18|  traversal_sequencer->SetTraverser(att_traverser);
  125|     18|  return std::move(traversal_sequencer);
  126|     18|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  6.28k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.17k|  const CornerTable *GetCornerTable() const override {
   67|  2.17k|    return corner_table_.get();
   68|  2.17k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  2.97M|                       int *out_encoder_split_symbol_id) {
   87|  2.97M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 22.0k, False: 2.95M]
  ------------------
   88|  22.0k|      return false;
   89|  22.0k|    }
   90|  2.95M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 18, False: 2.95M]
  ------------------
   91|  2.95M|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     18|      *out_encoder_split_symbol_id = -1;
   98|     18|      return true;
   99|     18|    }
  100|  2.95M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 2.95M, False: 1.29k]
  ------------------
  101|  2.95M|      return false;
  102|  2.95M|    }
  103|  1.29k|    *out_face_edge =
  104|  1.29k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.29k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.29k|    topology_split_data_.pop_back();
  108|  1.29k|    return true;
  109|  2.95M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  8.87M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  8.87M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  8.87M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  8.87M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  12.2k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  5.61k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  3.64k|  const CornerTable *GetCornerTable() const override {
   67|  3.64k|    return corner_table_.get();
   68|  3.64k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  25.4M|                       int *out_encoder_split_symbol_id) {
   87|  25.4M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 25.3M, False: 45.9k]
  ------------------
   88|  25.3M|      return false;
   89|  25.3M|    }
   90|  45.9k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 21, False: 45.9k]
  ------------------
   91|  45.9k|        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|  45.9k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 44.6k, False: 1.27k]
  ------------------
  101|  44.6k|      return false;
  102|  44.6k|    }
  103|  1.27k|    *out_face_edge =
  104|  1.27k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.27k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.27k|    topology_split_data_.pop_back();
  108|  1.27k|    return true;
  109|  45.9k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  75.7M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  75.7M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  75.7M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  75.7M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  8.28k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  10.4k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.04k|  const CornerTable *GetCornerTable() const override {
   67|  2.04k|    return corner_table_.get();
   68|  2.04k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  36.5M|                       int *out_encoder_split_symbol_id) {
   87|  36.5M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 36.1M, False: 463k]
  ------------------
   88|  36.1M|      return false;
   89|  36.1M|    }
   90|   463k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 28, False: 463k]
  ------------------
   91|   463k|        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|     28|      *out_encoder_split_symbol_id = -1;
   98|     28|      return true;
   99|     28|    }
  100|   463k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 462k, False: 1.17k]
  ------------------
  101|   462k|      return false;
  102|   462k|    }
  103|  1.17k|    *out_face_edge =
  104|  1.17k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.17k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.17k|    topology_split_data_.pop_back();
  108|  1.17k|    return true;
  109|   463k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  46.9M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  46.9M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  46.9M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  46.9M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  12.7k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  7.12k|      : attribute_connectivity_decoders_(nullptr),
   34|  7.12k|        num_attribute_data_(0),
   35|  7.12k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  5.90k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  5.90k|    decoder_impl_ = decoder;
   38|  5.90k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  5.90k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  5.90k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  5.90k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  4.66k|  uint16_t BitstreamVersion() const {
   45|  4.66k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  4.66k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.09k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  5.90k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  3.96k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  3.96k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 133, False: 3.83k]
  ------------------
   63|    133|      return false;
   64|    133|    }
   65|       |
   66|  3.83k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 108, False: 3.72k]
  ------------------
   67|    108|      return false;
   68|    108|    }
   69|       |
   70|  3.72k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 24, False: 3.70k]
  ------------------
   71|     24|      return false;
   72|     24|    }
   73|  3.70k|    *out_buffer = buffer_;
   74|  3.70k|    return true;
   75|  3.72k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  2.37M|  inline bool DecodeStartFaceConfiguration() {
   79|  2.37M|    uint32_t face_configuration;
   80|  2.37M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  2.37M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.37M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 478, False: 2.37M]
  ------------------
   82|    478|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    478|    } else
   85|  2.37M|#endif
   86|  2.37M|    {
   87|  2.37M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  2.37M|    }
   89|  2.37M|    return face_configuration;
   90|  2.37M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  6.73M|  inline uint32_t DecodeSymbol() {
   94|  6.73M|    uint32_t symbol;
   95|  6.73M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  6.73M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 3.00M, False: 3.73M]
  ------------------
   97|  3.00M|      return symbol;
   98|  3.00M|    }
   99|       |    // Else decode two additional bits.
  100|  3.73M|    uint32_t symbol_suffix;
  101|  3.73M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  3.73M|    symbol |= (symbol_suffix << 1);
  103|  3.73M|    return symbol;
  104|  6.73M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  6.66M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|   726k|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  19.0M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  19.0M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  19.0M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  3.43k|  void Done() {
  123|  3.43k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 3.28k, False: 149]
  ------------------
  124|  3.28k|      symbol_buffer_.EndBitDecoding();
  125|  3.28k|    }
  126|  3.43k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  3.43k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.43k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 247, False: 3.18k]
  ------------------
  128|    247|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    247|    } else
  131|  3.18k|#endif
  132|  3.18k|    {
  133|  3.18k|      start_face_decoder_.EndDecoding();
  134|  3.18k|    }
  135|  3.43k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  1.77k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  4.14k|  bool DecodeTraversalSymbols() {
  141|  4.14k|    uint64_t traversal_size;
  142|  4.14k|    symbol_buffer_ = buffer_;
  143|  4.14k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 41, False: 4.10k]
  ------------------
  144|     41|      return false;
  145|     41|    }
  146|  4.10k|    buffer_ = symbol_buffer_;
  147|  4.10k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 150, False: 3.95k]
  ------------------
  148|    150|      return false;
  149|    150|    }
  150|  3.95k|    buffer_.Advance(traversal_size);
  151|  3.95k|    return true;
  152|  4.10k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  5.71k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  5.71k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  5.71k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.71k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 454, False: 5.25k]
  ------------------
  158|    454|      start_face_buffer_ = buffer_;
  159|    454|      uint64_t traversal_size;
  160|    454|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 4, False: 450]
  ------------------
  161|      4|        return false;
  162|      4|      }
  163|    450|      buffer_ = start_face_buffer_;
  164|    450|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 135, False: 315]
  ------------------
  165|    135|        return false;
  166|    135|      }
  167|    315|      buffer_.Advance(traversal_size);
  168|    315|      return true;
  169|    450|    }
  170|  5.25k|#endif
  171|  5.25k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  5.71k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  5.51k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  5.51k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 3.58k, False: 1.93k]
  ------------------
  177|  3.58k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  3.58k|          new BinaryDecoder[num_attribute_data_]);
  179|  9.85k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 6.31k, False: 3.54k]
  ------------------
  180|  6.31k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 40, False: 6.27k]
  ------------------
  181|     40|          return false;
  182|     40|        }
  183|  6.31k|      }
  184|  3.58k|    }
  185|  5.47k|    return true;
  186|  5.51k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  3.87k|MeshSequentialDecoder::MeshSequentialDecoder() {}
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  3.70k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  3.70k|  uint32_t num_faces;
   31|  3.70k|  uint32_t num_points;
   32|  3.70k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  3.70k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.70k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 656, False: 3.05k]
  ------------------
   34|    656|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 6, False: 650]
  ------------------
   35|      6|      return false;
   36|      6|    }
   37|    650|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 4, False: 646]
  ------------------
   38|      4|      return false;
   39|      4|    }
   40|       |
   41|    650|  } else
   42|  3.05k|#endif
   43|  3.05k|  {
   44|  3.05k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 10, False: 3.04k]
  ------------------
   45|     10|      return false;
   46|     10|    }
   47|  3.04k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 7, False: 3.03k]
  ------------------
   48|      7|      return false;
   49|      7|    }
   50|  3.04k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  3.67k|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|  3.67k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 2, False: 3.67k]
  ------------------
   56|      2|    return false;
   57|      2|  }
   58|  3.67k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 27, False: 3.65k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|     27|    return false;
   62|     27|  }
   63|  3.65k|  uint8_t connectivity_method;
   64|  3.65k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 2, False: 3.64k]
  ------------------
   65|      2|    return false;
   66|      2|  }
   67|  3.64k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 2.92k, False: 728]
  ------------------
   68|  2.92k|    if (!DecodeAndDecompressIndices(num_faces)) {
  ------------------
  |  Branch (68:9): [True: 2.76k, False: 156]
  ------------------
   69|  2.76k|      return false;
   70|  2.76k|    }
   71|  2.92k|  } else {
   72|    728|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 564, False: 164]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  72.7k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 72.2k, False: 558]
  ------------------
   75|  72.2k|        Mesh::Face face;
   76|   288k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 216k, False: 72.2k]
  ------------------
   77|   216k|          uint8_t val;
   78|   216k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 6, False: 216k]
  ------------------
   79|      6|            return false;
   80|      6|          }
   81|   216k|          face[j] = val;
   82|   216k|        }
   83|  72.2k|        mesh()->AddFace(face);
   84|  72.2k|      }
   85|    564|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (85:16): [True: 65, False: 99]
  ------------------
   86|       |      // Decode indices as uint16_t.
   87|  6.11k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (87:28): [True: 6.07k, False: 39]
  ------------------
   88|  6.07k|        Mesh::Face face;
   89|  24.2k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (89:25): [True: 18.1k, False: 6.04k]
  ------------------
   90|  18.1k|          uint16_t val;
   91|  18.1k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (91:15): [True: 26, False: 18.1k]
  ------------------
   92|     26|            return false;
   93|     26|          }
   94|  18.1k|          face[j] = val;
   95|  18.1k|        }
   96|  6.04k|        mesh()->AddFace(face);
   97|  6.04k|      }
   98|     99|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (98:16): [True: 36, False: 63]
  ------------------
   99|     36|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     36|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (99:16): [True: 30, False: 6]
  ------------------
  100|       |      // Decode indices as uint32_t.
  101|    327|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (101:28): [True: 310, False: 17]
  ------------------
  102|    310|        Mesh::Face face;
  103|  1.21k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (103:25): [True: 919, False: 297]
  ------------------
  104|    919|          uint32_t val;
  105|    919|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (105:15): [True: 13, False: 906]
  ------------------
  106|     13|            return false;
  107|     13|          }
  108|    906|          face[j] = val;
  109|    906|        }
  110|    297|        mesh()->AddFace(face);
  111|    297|      }
  112|     69|    } else {
  113|       |      // Decode faces as uint32_t (default).
  114|    729|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (114:28): [True: 690, False: 39]
  ------------------
  115|    690|        Mesh::Face face;
  116|  2.68k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (116:25): [True: 2.02k, False: 660]
  ------------------
  117|  2.02k|          uint32_t val;
  118|  2.02k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (118:15): [True: 30, False: 1.99k]
  ------------------
  119|     30|            return false;
  120|     30|          }
  121|  1.99k|          face[j] = val;
  122|  1.99k|        }
  123|    660|        mesh()->AddFace(face);
  124|    660|      }
  125|     69|    }
  126|    728|  }
  127|    809|  point_cloud()->set_num_points(num_points);
  128|    809|  return true;
  129|  3.64k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  131|  16.9k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  132|       |  // Always create the basic attribute decoder.
  133|  16.9k|  return SetAttributesDecoder(
  134|  16.9k|      att_decoder_id,
  135|  16.9k|      std::unique_ptr<AttributesDecoder>(
  136|  16.9k|          new SequentialAttributeDecodersController(
  137|  16.9k|              std::unique_ptr<PointsSequencer>(
  138|  16.9k|                  new LinearSequencer(point_cloud()->num_points())))));
  139|  16.9k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEj:
  141|  2.92k|bool MeshSequentialDecoder::DecodeAndDecompressIndices(uint32_t num_faces) {
  142|       |  // Get decoded indices differences that were encoded with an entropy code.
  143|  2.92k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  144|  2.92k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (144:7): [True: 2.68k, False: 232]
  ------------------
  145|  2.68k|    return false;
  146|  2.68k|  }
  147|       |  // Reconstruct the indices from the differences.
  148|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  149|    232|  int32_t last_index_value = 0;  // This will always be >= 0.
  150|    232|  int vertex_index = 0;
  151|  6.80k|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (151:24): [True: 6.64k, False: 156]
  ------------------
  152|  6.64k|    Mesh::Face face;
  153|  26.3k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (153:21): [True: 19.8k, False: 6.57k]
  ------------------
  154|  19.8k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  155|  19.8k|      int32_t index_diff = (encoded_val >> 1);
  156|  19.8k|      if (encoded_val & 1) {
  ------------------
  |  Branch (156:11): [True: 436, False: 19.3k]
  ------------------
  157|    436|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (157:13): [True: 59, False: 377]
  ------------------
  158|       |          // Subtracting index_diff would result in a negative index.
  159|     59|          return false;
  160|     59|        }
  161|    377|        index_diff = -index_diff;
  162|  19.3k|      } else {
  163|  19.3k|        if (index_diff >
  ------------------
  |  Branch (163:13): [True: 17, False: 19.3k]
  ------------------
  164|  19.3k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  165|       |          // Adding index_diff to last_index_value would overflow.
  166|     17|          return false;
  167|     17|        }
  168|  19.3k|      }
  169|  19.7k|      const int32_t index_value = index_diff + last_index_value;
  170|  19.7k|      face[j] = index_value;
  171|  19.7k|      last_index_value = index_value;
  172|  19.7k|    }
  173|  6.57k|    mesh()->AddFace(face);
  174|  6.57k|  }
  175|    156|  return true;
  176|    232|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.17k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.78M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.78M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 2.78M, False: 3.30k]
  ------------------
   61|  2.78M|      return true;  // Already traversed.
   62|  2.78M|    }
   63|       |
   64|  3.30k|    corner_traversal_stack_.clear();
   65|  3.30k|    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|  3.30k|    const VertexIndex next_vert =
   69|  3.30k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.30k|    const VertexIndex prev_vert =
   71|  3.30k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.30k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.30k]
  |  Branch (72:45): [True: 0, False: 3.30k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.30k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.55k, False: 754]
  ------------------
   76|  2.55k|      this->MarkVertexVisited(next_vert);
   77|  2.55k|      this->traversal_observer().OnNewVertexVisited(
   78|  2.55k|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.55k|    }
   80|  3.30k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.81k, False: 490]
  ------------------
   81|  2.81k|      this->MarkVertexVisited(prev_vert);
   82|  2.81k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.81k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.81k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  20.9k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 17.6k, False: 3.30k]
  ------------------
   88|       |      // Currently processed corner.
   89|  17.6k|      corner_id = corner_traversal_stack_.back();
   90|  17.6k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  17.6k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 17.6k]
  |  Branch (92:47): [True: 795, False: 16.8k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    795|        corner_traversal_stack_.pop_back();
   95|    795|        continue;
   96|    795|      }
   97|  2.78M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.78M, Folded]
  ------------------
   98|  2.78M|        this->MarkFaceVisited(face_id);
   99|  2.78M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.78M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.78M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.78M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.78M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.40M, False: 1.37M]
  ------------------
  105|  1.40M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.40M|          this->MarkVertexVisited(vert_id);
  107|  1.40M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.40M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.37M, False: 35.5k]
  ------------------
  109|  1.37M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.37M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.37M|            continue;
  112|  1.37M|          }
  113|  1.40M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  1.41M|        const CornerIndex right_corner_id =
  118|  1.41M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.41M|        const CornerIndex left_corner_id =
  120|  1.41M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.41M|        const FaceIndex right_face_id(
  122|  1.41M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 24.7k, False: 1.38M]
  ------------------
  123|  1.41M|                 ? kInvalidFaceIndex
  124|  1.41M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.41M|        const FaceIndex left_face_id(
  126|  1.41M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 12.8k, False: 1.39M]
  ------------------
  127|  1.41M|                 ? kInvalidFaceIndex
  128|  1.41M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.41M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.37M, False: 34.4k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.37M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 9.65k, False: 1.36M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  9.65k|            corner_traversal_stack_.pop_back();
  134|  9.65k|            break;  // Break from the while (true) loop.
  135|  1.36M|          } else {
  136|       |            // Go to the left face.
  137|  1.36M|            corner_id = left_corner_id;
  138|  1.36M|            face_id = left_face_id;
  139|  1.36M|          }
  140|  1.37M|        } else {
  141|       |          // Right face was not visited.
  142|  34.4k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 27.2k, False: 7.15k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  27.2k|            corner_id = right_corner_id;
  145|  27.2k|            face_id = right_face_id;
  146|  27.2k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  7.15k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  7.15k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  7.15k|            break;
  159|  7.15k|          }
  160|  34.4k|        }
  161|  1.41M|      }
  162|  16.8k|    }
  163|  3.30k|    return true;
  164|  3.30k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.17k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.44k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.40k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.59M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.59M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 866k, False: 2.72M]
  ------------------
   61|   866k|      return true;  // Already traversed.
   62|   866k|    }
   63|       |
   64|  2.72M|    corner_traversal_stack_.clear();
   65|  2.72M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.72M|    const VertexIndex next_vert =
   69|  2.72M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.72M|    const VertexIndex prev_vert =
   71|  2.72M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.72M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.72M]
  |  Branch (72:45): [True: 0, False: 2.72M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.72M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.72M, False: 1.35k]
  ------------------
   76|  2.72M|      this->MarkVertexVisited(next_vert);
   77|  2.72M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.72M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.72M|    }
   80|  2.72M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.72M, False: 1.19k]
  ------------------
   81|  2.72M|      this->MarkVertexVisited(prev_vert);
   82|  2.72M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.72M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.72M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  5.52M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.79M, False: 2.72M]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.79M|      corner_id = corner_traversal_stack_.back();
   90|  2.79M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.79M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.79M]
  |  Branch (92:47): [True: 5.12k, False: 2.79M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  5.12k|        corner_traversal_stack_.pop_back();
   95|  5.12k|        continue;
   96|  5.12k|      }
   97|  3.59M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.59M, Folded]
  ------------------
   98|  3.59M|        this->MarkFaceVisited(face_id);
   99|  3.59M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.59M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.59M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.59M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.59M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.18M, False: 412k]
  ------------------
  105|  3.18M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.18M|          this->MarkVertexVisited(vert_id);
  107|  3.18M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.18M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 398k, False: 2.78M]
  ------------------
  109|   398k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   398k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   398k|            continue;
  112|   398k|          }
  113|  3.18M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  3.19M|        const CornerIndex right_corner_id =
  118|  3.19M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.19M|        const CornerIndex left_corner_id =
  120|  3.19M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.19M|        const FaceIndex right_face_id(
  122|  3.19M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.75M, False: 437k]
  ------------------
  123|  3.19M|                 ? kInvalidFaceIndex
  124|  3.19M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.19M|        const FaceIndex left_face_id(
  126|  3.19M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.75M, False: 442k]
  ------------------
  127|  3.19M|                 ? kInvalidFaceIndex
  128|  3.19M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.19M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.14M, False: 52.9k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.14M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.75M, False: 386k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.75M|            corner_traversal_stack_.pop_back();
  134|  2.75M|            break;  // Break from the while (true) loop.
  135|  2.75M|          } else {
  136|       |            // Go to the left face.
  137|   386k|            corner_id = left_corner_id;
  138|   386k|            face_id = left_face_id;
  139|   386k|          }
  140|  3.14M|        } else {
  141|       |          // Right face was not visited.
  142|  52.9k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 19.4k, False: 33.5k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  19.4k|            corner_id = right_corner_id;
  145|  19.4k|            face_id = right_face_id;
  146|  33.5k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  33.5k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  33.5k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  33.5k|            break;
  159|  33.5k|          }
  160|  52.9k|        }
  161|  3.19M|      }
  162|  2.79M|    }
  163|  2.72M|    return true;
  164|  2.72M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.40k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.93k|  DepthFirstTraverser() {}

_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   58|    311|  void OnTraversalStart() {
   59|    311|    prediction_degree_.resize(this->corner_table()->num_vertices(), 0);
   60|    311|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.24M|  bool TraverseFromCorner(CornerIndex corner_id) {
   66|  2.24M|    if (prediction_degree_.size() == 0) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2.24M]
  ------------------
   67|      0|      return true;
   68|      0|    }
   69|       |
   70|       |    // Traversal starts from the |corner_id|. It's going to follow either the
   71|       |    // right or the left neighboring faces to |corner_id| based on their
   72|       |    // prediction degree.
   73|  2.24M|    traversal_stacks_[0].push_back(corner_id);
   74|  2.24M|    best_priority_ = 0;
   75|       |    // For the first face, check the remaining corners as they may not be
   76|       |    // processed yet.
   77|  2.24M|    const VertexIndex next_vert =
   78|  2.24M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   79|  2.24M|    const VertexIndex prev_vert =
   80|  2.24M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   81|  2.24M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (81:9): [True: 1.49k, False: 2.23M]
  ------------------
   82|  1.49k|      this->MarkVertexVisited(next_vert);
   83|  1.49k|      this->traversal_observer().OnNewVertexVisited(
   84|  1.49k|          next_vert, this->corner_table()->Next(corner_id));
   85|  1.49k|    }
   86|  2.24M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (86:9): [True: 1.59k, False: 2.23M]
  ------------------
   87|  1.59k|      this->MarkVertexVisited(prev_vert);
   88|  1.59k|      this->traversal_observer().OnNewVertexVisited(
   89|  1.59k|          prev_vert, this->corner_table()->Previous(corner_id));
   90|  1.59k|    }
   91|  2.24M|    const VertexIndex tip_vertex = this->corner_table()->Vertex(corner_id);
   92|  2.24M|    if (!this->IsVertexVisited(tip_vertex)) {
  ------------------
  |  Branch (92:9): [True: 1.34k, False: 2.23M]
  ------------------
   93|  1.34k|      this->MarkVertexVisited(tip_vertex);
   94|  1.34k|      this->traversal_observer().OnNewVertexVisited(tip_vertex, corner_id);
   95|  1.34k|    }
   96|       |    // Start the actual traversal.
   97|  6.60M|    while ((corner_id = PopNextCornerToTraverse()) != kInvalidCornerIndex) {
  ------------------
  |  Branch (97:12): [True: 4.36M, False: 2.24M]
  ------------------
   98|  4.36M|      FaceIndex face_id(corner_id.value() / 3);
   99|       |      // Make sure the face hasn't been visited yet.
  100|  4.36M|      if (this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (100:11): [True: 3.34M, False: 1.01M]
  ------------------
  101|       |        // This face has been already traversed.
  102|  3.34M|        continue;
  103|  3.34M|      }
  104|       |
  105|  2.24M|      while (true) {
  ------------------
  |  Branch (105:14): [True: 2.24M, Folded]
  ------------------
  106|  2.24M|        face_id = FaceIndex(corner_id.value() / 3);
  107|  2.24M|        this->MarkFaceVisited(face_id);
  108|  2.24M|        this->traversal_observer().OnNewFaceVisited(face_id);
  109|       |
  110|       |        // If the newly reached vertex hasn't been visited, mark it and notify
  111|       |        // the observer.
  112|  2.24M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  113|  2.24M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (113:13): [True: 1.13M, False: 1.10M]
  ------------------
  114|  1.13M|          this->MarkVertexVisited(vert_id);
  115|  1.13M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  116|  1.13M|        }
  117|       |
  118|       |        // Check whether we can traverse to the right and left neighboring
  119|       |        // faces.
  120|  2.24M|        const CornerIndex right_corner_id =
  121|  2.24M|            this->corner_table()->GetRightCorner(corner_id);
  122|  2.24M|        const CornerIndex left_corner_id =
  123|  2.24M|            this->corner_table()->GetLeftCorner(corner_id);
  124|  2.24M|        const FaceIndex right_face_id(
  125|  2.24M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (125:14): [True: 15.4k, False: 2.22M]
  ------------------
  126|  2.24M|                 ? kInvalidFaceIndex
  127|  2.24M|                 : FaceIndex(right_corner_id.value() / 3)));
  128|  2.24M|        const FaceIndex left_face_id(
  129|  2.24M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (129:14): [True: 17.9k, False: 2.22M]
  ------------------
  130|  2.24M|                 ? kInvalidFaceIndex
  131|  2.24M|                 : FaceIndex(left_corner_id.value() / 3)));
  132|  2.24M|        const bool is_right_face_visited = this->IsFaceVisited(right_face_id);
  133|  2.24M|        const bool is_left_face_visited = this->IsFaceVisited(left_face_id);
  134|       |
  135|  2.24M|        if (!is_left_face_visited) {
  ------------------
  |  Branch (135:13): [True: 1.71M, False: 525k]
  ------------------
  136|       |          // We can go to the left face.
  137|  1.71M|          const int priority = ComputePriority(left_corner_id);
  138|  1.71M|          if (is_right_face_visited && priority <= best_priority_) {
  ------------------
  |  Branch (138:15): [True: 607k, False: 1.10M]
  |  Branch (138:40): [True: 587k, False: 19.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|   587k|            corner_id = left_corner_id;
  144|   587k|            continue;
  145|  1.12M|          } else {
  146|  1.12M|            AddCornerToTraversalStack(left_corner_id, priority);
  147|  1.12M|          }
  148|  1.71M|        }
  149|  1.65M|        if (!is_right_face_visited) {
  ------------------
  |  Branch (149:13): [True: 1.62M, False: 25.9k]
  ------------------
  150|       |          // Go to the right face.
  151|  1.62M|          const int priority = ComputePriority(right_corner_id);
  152|  1.62M|          if (priority <= best_priority_) {
  ------------------
  |  Branch (152:15): [True: 635k, False: 992k]
  ------------------
  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|   635k|            corner_id = right_corner_id;
  156|   635k|            continue;
  157|   992k|          } else {
  158|   992k|            AddCornerToTraversalStack(right_corner_id, priority);
  159|   992k|          }
  160|  1.62M|        }
  161|       |
  162|       |        // Couldn't proceed directly to the next corner
  163|  1.01M|        break;
  164|  1.65M|      }
  165|  1.01M|    }
  166|  2.24M|    return true;
  167|  2.24M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE23PopNextCornerToTraverseEv:
  173|  6.60M|  CornerIndex PopNextCornerToTraverse() {
  174|  13.8M|    for (int i = best_priority_; i < kMaxPriority; ++i) {
  ------------------
  |  Branch (174:34): [True: 11.5M, False: 2.24M]
  ------------------
  175|  11.5M|      if (!traversal_stacks_[i].empty()) {
  ------------------
  |  Branch (175:11): [True: 4.36M, False: 7.23M]
  ------------------
  176|  4.36M|        const CornerIndex ret = traversal_stacks_[i].back();
  177|  4.36M|        traversal_stacks_[i].pop_back();
  178|  4.36M|        best_priority_ = i;
  179|  4.36M|        return ret;
  180|  4.36M|      }
  181|  11.5M|    }
  182|  2.24M|    return kInvalidCornerIndex;
  183|  6.60M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15ComputePriorityENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  194|  3.34M|  inline int ComputePriority(CornerIndex corner_id) {
  195|  3.34M|    const VertexIndex v_tip = this->corner_table()->Vertex(corner_id);
  196|       |    // Priority 0 when traversing to already visited vertices.
  197|  3.34M|    int priority = 0;
  198|  3.34M|    if (!this->IsVertexVisited(v_tip)) {
  ------------------
  |  Branch (198:9): [True: 2.23M, False: 1.10M]
  ------------------
  199|  2.23M|      const int degree = ++prediction_degree_[v_tip];
  200|       |      // Priority 1 when prediction degree > 1, otherwise 2.
  201|  2.23M|      priority = (degree > 1 ? 1 : 2);
  ------------------
  |  Branch (201:19): [True: 1.10M, False: 1.13M]
  ------------------
  202|  2.23M|    }
  203|       |    // Clamp the priority to the maximum number of buckets.
  204|  3.34M|    if (priority >= kMaxPriority) {
  ------------------
  |  Branch (204:9): [True: 0, False: 3.34M]
  ------------------
  205|      0|      priority = kMaxPriority - 1;
  206|      0|    }
  207|  3.34M|    return priority;
  208|  3.34M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE25AddCornerToTraversalStackENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEi:
  185|  2.12M|  inline void AddCornerToTraversalStack(CornerIndex ci, int priority) {
  186|  2.12M|    traversal_stacks_[priority].push_back(ci);
  187|       |    // Make sure that the best available priority is up to date.
  188|  2.12M|    if (priority < best_priority_) {
  ------------------
  |  Branch (188:9): [True: 507k, False: 1.61M]
  ------------------
  189|   507k|      best_priority_ = priority;
  190|   507k|    }
  191|  2.12M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   63|    311|  void OnTraversalEnd() {}
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   55|    678|  MaxPredictionDegreeTraverser() {}

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    339|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.22k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.22k|    const auto *corner_table = traverser_.corner_table();
   50|  1.22k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.22k|    const size_t num_faces = mesh_->num_faces();
   52|  1.22k|    const size_t num_points = mesh_->num_points();
   53|  3.88M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 3.88M, False: 1.22k]
  ------------------
   54|  3.88M|      const auto &face = mesh_->face(f);
   55|  15.5M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 11.6M, False: 3.88M]
  ------------------
   56|  11.6M|        const PointIndex point_id = face[p];
   57|  11.6M|        const VertexIndex vert_id =
   58|  11.6M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  11.6M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 11.6M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  11.6M|        const AttributeValueIndex att_entry_id(
   63|  11.6M|            encoding_data_
   64|  11.6M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  11.6M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 11.6M]
  |  Branch (65:13): [True: 0, False: 11.6M]
  |  Branch (65:39): [True: 0, False: 11.6M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  11.6M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  11.6M|      }
   71|  3.88M|    }
   72|  1.22k|    return true;
   73|  1.22k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    311|  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|    311|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    311|    traverser_.OnTraversalStart();
   82|    311|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 311]
  ------------------
   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|    311|    } else {
   89|    311|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.24M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.24M, False: 311]
  ------------------
   91|  2.24M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.24M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.24M|      }
   95|    311|    }
   96|    311|    traverser_.OnTraversalEnd();
   97|    311|    return true;
   98|    311|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.24M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.24M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.24M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    339|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.22k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.44k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.44k|    const auto *corner_table = traverser_.corner_table();
   50|  5.44k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.44k|    const size_t num_faces = mesh_->num_faces();
   52|  5.44k|    const size_t num_points = mesh_->num_points();
   53|  4.54M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.53M, False: 5.44k]
  ------------------
   54|  4.53M|      const auto &face = mesh_->face(f);
   55|  18.1M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.6M, False: 4.53M]
  ------------------
   56|  13.6M|        const PointIndex point_id = face[p];
   57|  13.6M|        const VertexIndex vert_id =
   58|  13.6M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  13.6M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 13.6M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  13.6M|        const AttributeValueIndex att_entry_id(
   63|  13.6M|            encoding_data_
   64|  13.6M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  13.6M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 13.6M]
  |  Branch (65:13): [True: 0, False: 13.6M]
  |  Branch (65:39): [True: 0, False: 13.6M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  13.6M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  13.6M|      }
   71|  4.53M|    }
   72|  5.44k|    return true;
   73|  5.44k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.17k|  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.17k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.17k|    traverser_.OnTraversalStart();
   82|  1.17k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.17k]
  ------------------
   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.17k|    } else {
   89|  1.17k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.78M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.78M, False: 1.17k]
  ------------------
   91|  2.78M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.78M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.78M|      }
   95|  1.17k|    }
   96|  1.17k|    traverser_.OnTraversalEnd();
   97|  1.17k|    return true;
   98|  1.17k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.78M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.78M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.78M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.22k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.46k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  6.42k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  6.42k|    const auto *corner_table = traverser_.corner_table();
   50|  6.42k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  6.42k|    const size_t num_faces = mesh_->num_faces();
   52|  6.42k|    const size_t num_points = mesh_->num_points();
   53|  5.63M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.63M, False: 6.42k]
  ------------------
   54|  5.63M|      const auto &face = mesh_->face(f);
   55|  22.5M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 16.9M, False: 5.63M]
  ------------------
   56|  16.9M|        const PointIndex point_id = face[p];
   57|  16.9M|        const VertexIndex vert_id =
   58|  16.9M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  16.9M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 16.9M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  16.9M|        const AttributeValueIndex att_entry_id(
   63|  16.9M|            encoding_data_
   64|  16.9M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  16.9M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 16.9M]
  |  Branch (65:13): [True: 0, False: 16.9M]
  |  Branch (65:39): [True: 0, False: 16.9M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  16.9M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  16.9M|      }
   71|  5.63M|    }
   72|  6.42k|    return true;
   73|  6.42k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.40k|  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.40k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.40k|    traverser_.OnTraversalStart();
   82|  1.40k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.40k]
  ------------------
   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.40k|    } else {
   89|  1.40k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.59M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.59M, False: 1.40k]
  ------------------
   91|  3.59M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.59M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.59M|      }
   95|  1.40k|    }
   96|  1.40k|    traverser_.OnTraversalEnd();
   97|  1.40k|    return true;
   98|  1.40k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.59M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.59M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.59M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.46k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.93k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  29.7M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  15.1M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  15.1M|    return is_vertex_visited_[vert_id.value()];
   65|  15.1M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.55M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.55M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.55M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  7.58M|  inline TraversalObserverT &traversal_observer() {
   75|  7.58M|    return traversal_observer_;
   76|  7.58M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  11.6M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  11.6M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 71.0k, False: 11.6M]
  ------------------
   47|  71.0k|      return true;  // Invalid faces are always considered as visited.
   48|  71.0k|    }
   49|  11.6M|    return is_face_visited_[face_id.value()];
   50|  11.6M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  5.02M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  5.02M|    is_face_visited_[face_id.value()] = true;
   62|  5.02M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.12k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.12k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.56k|                    TraversalObserver traversal_observer) {
   37|  1.56k|    corner_table_ = corner_table;
   38|  1.56k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.56k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.56k|    traversal_observer_ = traversal_observer;
   41|  1.56k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.78M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.78M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.78M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.78M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.78M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  29.9M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.59M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.59M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.59M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.59M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.59M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  9.05M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  9.05M|    return is_vertex_visited_[vert_id.value()];
   65|  9.05M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  8.63M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  8.63M|    is_vertex_visited_[vert_id.value()] = true;
   68|  8.63M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  12.2M|  inline TraversalObserverT &traversal_observer() {
   75|  12.2M|    return traversal_observer_;
   76|  12.2M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  9.18M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  9.18M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 5.51M, False: 3.67M]
  ------------------
   47|  5.51M|      return true;  // Invalid faces are always considered as visited.
   48|  5.51M|    }
   49|  3.67M|    return is_face_visited_[face_id.value()];
   50|  9.18M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.59M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.59M|    is_face_visited_[face_id.value()] = true;
   62|  3.59M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.93k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.46k|                    TraversalObserver traversal_observer) {
   37|  1.46k|    corner_table_ = corner_table;
   38|  1.46k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.46k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.46k|    traversal_observer_ = traversal_observer;
   41|  1.46k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    234|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    234|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 11, False: 223]
  ------------------
  187|     11|    return false;
  188|     11|  }
  189|    223|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 11, False: 212]
  ------------------
  190|     11|    return false;
  191|     11|  }
  192|    212|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 11, False: 201]
  ------------------
  193|     11|    return false;
  194|     11|  }
  195|    201|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 72, False: 129]
  ------------------
  196|     72|    return true;
  197|     72|  }
  198|    129|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 25, False: 104]
  ------------------
  199|     25|    return false;
  200|     25|  }
  201|    104|  num_decoded_points_ = 0;
  202|       |
  203|    104|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 21, False: 83]
  ------------------
  204|     21|    return false;
  205|     21|  }
  206|     83|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 6, False: 77]
  ------------------
  207|      6|    return false;
  208|      6|  }
  209|     77|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 76]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     76|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 73]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     73|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 54, False: 19]
  ------------------
  217|     54|    return false;
  218|     54|  }
  219|       |
  220|     19|  numbers_decoder_.EndDecoding();
  221|     19|  remaining_bits_decoder_.EndDecoding();
  222|     19|  axis_decoder_.EndDecoding();
  223|     19|  half_decoder_.EndDecoding();
  224|       |
  225|     19|  return true;
  226|     73|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     73|    uint32_t num_points, OutputIteratorT &oit) {
  254|     73|  typedef DecodingStatus Status;
  255|     73|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     73|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     73|  DecodingStatus init_status(num_points, 0, 0);
  258|     73|  std::stack<Status> status_stack;
  259|     73|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.18M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.18M, False: 19]
  ------------------
  263|  3.18M|    const DecodingStatus status = status_stack.top();
  264|  3.18M|    status_stack.pop();
  265|       |
  266|  3.18M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.18M|    const uint32_t last_axis = status.last_axis;
  268|  3.18M|    const uint32_t stack_pos = status.stack_pos;
  269|  3.18M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.18M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.18M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.18M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.18M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.18M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.18M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.18M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.18M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.58M, False: 1.59M]
  ------------------
  285|   296M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 294M, False: 1.58M]
  ------------------
  286|   294M|        *oit = old_base;
  287|   294M|        ++oit;
  288|   294M|        ++num_decoded_points_;
  289|   294M|      }
  290|  1.58M|      continue;
  291|  1.58M|    }
  292|       |
  293|  1.59M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.59M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.85k, False: 1.59M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.85k|      axes_[0] = axis;
  300|  12.1k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 10.3k, False: 1.85k]
  ------------------
  301|  10.3k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  10.3k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 648, False: 9.67k]
  |  |  ------------------
  ------------------
  302|  10.3k|      }
  303|  4.98k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.16k, False: 1.82k]
  ------------------
  304|  23.6k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 20.4k, False: 3.13k]
  ------------------
  305|  20.4k|          p_[axes_[j]] = 0;
  306|  20.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  20.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 7.30k, False: 13.1k]
  ------------------
  308|  7.30k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 30, False: 7.27k]
  ------------------
  309|  7.30k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     30|              return false;
  311|     30|            }
  312|  7.30k|          }
  313|  20.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  20.4k|        }
  315|  3.13k|        *oit = p_;
  316|  3.13k|        ++oit;
  317|  3.13k|        ++num_decoded_points_;
  318|  3.13k|      }
  319|  1.82k|      continue;
  320|  1.85k|    }
  321|       |
  322|  1.59M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.59M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.59M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.59M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.59M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.59M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.59M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.59M|    uint32_t number = 0;
  334|  1.59M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.59M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.59M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 24, False: 1.59M]
  ------------------
  338|       |      // Invalid |number|.
  339|     24|      return false;
  340|     24|    }
  341|  1.59M|    first_half -= number;
  342|  1.59M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.59M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 859k, False: 731k]
  ------------------
  345|   859k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 856k, False: 2.20k]
  ------------------
  346|   856k|        std::swap(first_half, second_half);
  347|   856k|      }
  348|   859k|    }
  349|       |
  350|  1.59M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.59M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.59M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.59M, False: 59]
  ------------------
  353|  1.59M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.59M|    }
  355|  1.59M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.59M, False: 115]
  ------------------
  356|  1.59M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.59M|    }
  358|  1.59M|  }
  359|     19|  return true;
  360|     73|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  4.03M|        : num_remaining_points(num_remaining_points_),
  135|  4.03M|          last_axis(last_axis_),
  136|  4.03M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  2.01M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.01M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.01M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     72|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    343|      : bit_length_(0),
   87|    343|        num_points_(0),
   88|    343|        num_decoded_points_(0),
   89|    343|        dimension_(dimension),
   90|    343|        p_(dimension, 0),
   91|    343|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    343|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    343|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    184|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    184|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 7, False: 177]
  ------------------
  187|      7|    return false;
  188|      7|  }
  189|    177|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 15, False: 162]
  ------------------
  190|     15|    return false;
  191|     15|  }
  192|    162|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 159]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    159|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 37, False: 122]
  ------------------
  196|     37|    return true;
  197|     37|  }
  198|    122|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 18, False: 104]
  ------------------
  199|     18|    return false;
  200|     18|  }
  201|    104|  num_decoded_points_ = 0;
  202|       |
  203|    104|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 19, False: 85]
  ------------------
  204|     19|    return false;
  205|     19|  }
  206|     85|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 82]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     82|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 79]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     79|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 76]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     76|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 56, False: 20]
  ------------------
  217|     56|    return false;
  218|     56|  }
  219|       |
  220|     20|  numbers_decoder_.EndDecoding();
  221|     20|  remaining_bits_decoder_.EndDecoding();
  222|     20|  axis_decoder_.EndDecoding();
  223|     20|  half_decoder_.EndDecoding();
  224|       |
  225|     20|  return true;
  226|     76|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     76|    uint32_t num_points, OutputIteratorT &oit) {
  254|     76|  typedef DecodingStatus Status;
  255|     76|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     76|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     76|  DecodingStatus init_status(num_points, 0, 0);
  258|     76|  std::stack<Status> status_stack;
  259|     76|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  5.78M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 5.78M, False: 20]
  ------------------
  263|  5.78M|    const DecodingStatus status = status_stack.top();
  264|  5.78M|    status_stack.pop();
  265|       |
  266|  5.78M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  5.78M|    const uint32_t last_axis = status.last_axis;
  268|  5.78M|    const uint32_t stack_pos = status.stack_pos;
  269|  5.78M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  5.78M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  5.78M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 5.78M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  5.78M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  5.78M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 5.78M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  5.78M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  5.78M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.89M, False: 2.89M]
  ------------------
  285|   307M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 304M, False: 2.89M]
  ------------------
  286|   304M|        *oit = old_base;
  287|   304M|        ++oit;
  288|   304M|        ++num_decoded_points_;
  289|   304M|      }
  290|  2.89M|      continue;
  291|  2.89M|    }
  292|       |
  293|  2.89M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  2.89M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.18k, False: 2.89M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.18k|      axes_[0] = axis;
  300|  15.1k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 12.9k, False: 2.18k]
  ------------------
  301|  12.9k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  12.9k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 460, False: 12.4k]
  |  |  ------------------
  ------------------
  302|  12.9k|      }
  303|  5.96k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.81k, False: 2.15k]
  ------------------
  304|  29.8k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 26.0k, False: 3.78k]
  ------------------
  305|  26.0k|          p_[axes_[j]] = 0;
  306|  26.0k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  26.0k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.01k, False: 21.0k]
  ------------------
  308|  5.01k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 34, False: 4.98k]
  ------------------
  309|  5.01k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     34|              return false;
  311|     34|            }
  312|  5.01k|          }
  313|  26.0k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  26.0k|        }
  315|  3.78k|        *oit = p_;
  316|  3.78k|        ++oit;
  317|  3.78k|        ++num_decoded_points_;
  318|  3.78k|      }
  319|  2.15k|      continue;
  320|  2.18k|    }
  321|       |
  322|  2.89M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.89M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.89M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.89M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.89M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.89M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.89M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.89M|    uint32_t number = 0;
  334|  2.89M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.89M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.89M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 22, False: 2.89M]
  ------------------
  338|       |      // Invalid |number|.
  339|     22|      return false;
  340|     22|    }
  341|  2.89M|    first_half -= number;
  342|  2.89M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.89M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.55M, False: 1.33M]
  ------------------
  345|  1.55M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.55M, False: 4.52k]
  ------------------
  346|  1.55M|        std::swap(first_half, second_half);
  347|  1.55M|      }
  348|  1.55M|    }
  349|       |
  350|  2.89M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.89M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.89M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.89M, False: 61]
  ------------------
  353|  2.89M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.89M|    }
  355|  2.89M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.89M, False: 387]
  ------------------
  356|  2.89M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.89M|    }
  358|  2.89M|  }
  359|     20|  return true;
  360|     76|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  7.68M|        : num_remaining_points(num_remaining_points_),
  135|  7.68M|          last_axis(last_axis_),
  136|  7.68M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  7.68M|    uint32_t last_axis) {
  232|  7.68M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 7.68M, Folded]
  ------------------
  233|  7.68M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  7.68M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 5.92M, False: 1.75M]
  |  |  ------------------
  ------------------
  234|  7.68M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  7.68M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  3.84M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  3.84M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  3.84M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     35|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    171|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    171|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 5, False: 166]
  ------------------
  187|      5|    return false;
  188|      5|  }
  189|    166|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 16, False: 150]
  ------------------
  190|     16|    return false;
  191|     16|  }
  192|    150|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 149]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    149|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 17, False: 132]
  ------------------
  196|     17|    return true;
  197|     17|  }
  198|    132|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 12, False: 120]
  ------------------
  199|     12|    return false;
  200|     12|  }
  201|    120|  num_decoded_points_ = 0;
  202|       |
  203|    120|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 19, False: 101]
  ------------------
  204|     19|    return false;
  205|     19|  }
  206|    101|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 11, False: 90]
  ------------------
  207|     11|    return false;
  208|     11|  }
  209|     90|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 88]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     88|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 4, False: 84]
  ------------------
  213|      4|    return false;
  214|      4|  }
  215|       |
  216|     84|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 77, False: 7]
  ------------------
  217|     77|    return false;
  218|     77|  }
  219|       |
  220|      7|  numbers_decoder_.EndDecoding();
  221|      7|  remaining_bits_decoder_.EndDecoding();
  222|      7|  axis_decoder_.EndDecoding();
  223|      7|  half_decoder_.EndDecoding();
  224|       |
  225|      7|  return true;
  226|     84|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     84|    uint32_t num_points, OutputIteratorT &oit) {
  254|     84|  typedef DecodingStatus Status;
  255|     84|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     84|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     84|  DecodingStatus init_status(num_points, 0, 0);
  258|     84|  std::stack<Status> status_stack;
  259|     84|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  39.4k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 39.4k, False: 7]
  ------------------
  263|  39.4k|    const DecodingStatus status = status_stack.top();
  264|  39.4k|    status_stack.pop();
  265|       |
  266|  39.4k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  39.4k|    const uint32_t last_axis = status.last_axis;
  268|  39.4k|    const uint32_t stack_pos = status.stack_pos;
  269|  39.4k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  39.4k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  39.4k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 39.4k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  39.4k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  39.4k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 39.4k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  39.4k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  39.4k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 5.51k, False: 33.9k]
  ------------------
  285|  3.91G|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 3.91G, False: 5.51k]
  ------------------
  286|  3.91G|        *oit = old_base;
  287|  3.91G|        ++oit;
  288|  3.91G|        ++num_decoded_points_;
  289|  3.91G|      }
  290|  5.51k|      continue;
  291|  5.51k|    }
  292|       |
  293|  33.9k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  33.9k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.24k, False: 31.6k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.24k|      axes_[0] = axis;
  300|  4.98k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.73k, False: 2.24k]
  ------------------
  301|  2.73k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.73k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 491, False: 2.24k]
  |  |  ------------------
  ------------------
  302|  2.73k|      }
  303|  5.95k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.73k, False: 2.22k]
  ------------------
  304|  11.8k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 8.15k, False: 3.71k]
  ------------------
  305|  8.15k|          p_[axes_[j]] = 0;
  306|  8.15k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  8.15k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 6.43k, False: 1.71k]
  ------------------
  308|  6.43k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 20, False: 6.41k]
  ------------------
  309|  6.43k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     20|              return false;
  311|     20|            }
  312|  6.43k|          }
  313|  8.13k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  8.13k|        }
  315|  3.71k|        *oit = p_;
  316|  3.71k|        ++oit;
  317|  3.71k|        ++num_decoded_points_;
  318|  3.71k|      }
  319|  2.22k|      continue;
  320|  2.24k|    }
  321|       |
  322|  31.6k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 31.6k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  31.6k|    const int num_remaining_bits = bit_length_ - level;
  327|  31.6k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  31.6k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  31.6k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  31.6k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  31.6k|    uint32_t number = 0;
  334|  31.6k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  31.6k|    uint32_t first_half = num_remaining_points / 2;
  337|  31.6k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 57, False: 31.6k]
  ------------------
  338|       |      // Invalid |number|.
  339|     57|      return false;
  340|     57|    }
  341|  31.6k|    first_half -= number;
  342|  31.6k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  31.6k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 28.2k, False: 3.37k]
  ------------------
  345|  28.2k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 25.2k, False: 2.96k]
  ------------------
  346|  25.2k|        std::swap(first_half, second_half);
  347|  25.2k|      }
  348|  28.2k|    }
  349|       |
  350|  31.6k|    levels_stack_[stack_pos][axis] += 1;
  351|  31.6k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  31.6k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 30.1k, False: 1.53k]
  ------------------
  353|  30.1k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  30.1k|    }
  355|  31.6k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 10.2k, False: 21.3k]
  ------------------
  356|  10.2k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  10.2k|    }
  358|  31.6k|  }
  359|      7|  return true;
  360|     84|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  8.57M|        : num_remaining_points(num_remaining_points_),
  135|  8.57M|          last_axis(last_axis_),
  136|  8.57M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  4.29M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  4.29M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  4.29M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|     16|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    270|      : bit_length_(0),
   87|    270|        num_points_(0),
   88|    270|        num_decoded_points_(0),
   89|    270|        dimension_(dimension),
   90|    270|        p_(dimension, 0),
   91|    270|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    270|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    270|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    156|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    156|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 154]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|    154|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 144]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|    144|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 143]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    143|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 19, False: 124]
  ------------------
  196|     19|    return true;
  197|     19|  }
  198|    124|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 8, False: 116]
  ------------------
  199|      8|    return false;
  200|      8|  }
  201|    116|  num_decoded_points_ = 0;
  202|       |
  203|    116|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 14, False: 102]
  ------------------
  204|     14|    return false;
  205|     14|  }
  206|    102|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 98]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     98|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 10, False: 88]
  ------------------
  210|     10|    return false;
  211|     10|  }
  212|     88|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 86]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     86|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 79, False: 7]
  ------------------
  217|     79|    return false;
  218|     79|  }
  219|       |
  220|      7|  numbers_decoder_.EndDecoding();
  221|      7|  remaining_bits_decoder_.EndDecoding();
  222|      7|  axis_decoder_.EndDecoding();
  223|      7|  half_decoder_.EndDecoding();
  224|       |
  225|      7|  return true;
  226|     86|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     86|    uint32_t num_points, OutputIteratorT &oit) {
  254|     86|  typedef DecodingStatus Status;
  255|     86|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     86|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     86|  DecodingStatus init_status(num_points, 0, 0);
  258|     86|  std::stack<Status> status_stack;
  259|     86|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  25.4k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 25.4k, False: 7]
  ------------------
  263|  25.4k|    const DecodingStatus status = status_stack.top();
  264|  25.4k|    status_stack.pop();
  265|       |
  266|  25.4k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  25.4k|    const uint32_t last_axis = status.last_axis;
  268|  25.4k|    const uint32_t stack_pos = status.stack_pos;
  269|  25.4k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  25.4k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  25.4k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 25.4k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  25.4k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  25.4k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 25.4k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  25.4k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  25.4k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.86k, False: 20.5k]
  ------------------
  285|  21.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 21.7M, False: 4.86k]
  ------------------
  286|  21.7M|        *oit = old_base;
  287|  21.7M|        ++oit;
  288|  21.7M|        ++num_decoded_points_;
  289|  21.7M|      }
  290|  4.86k|      continue;
  291|  4.86k|    }
  292|       |
  293|  20.5k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  20.5k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.91k, False: 18.6k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.91k|      axes_[0] = axis;
  300|  4.84k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.92k, False: 1.91k]
  ------------------
  301|  2.92k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.92k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 538, False: 2.38k]
  |  |  ------------------
  ------------------
  302|  2.92k|      }
  303|  5.15k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.25k, False: 1.89k]
  ------------------
  304|  11.4k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 8.19k, False: 3.23k]
  ------------------
  305|  8.19k|          p_[axes_[j]] = 0;
  306|  8.19k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  8.19k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.48k, False: 2.70k]
  ------------------
  308|  5.48k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 26, False: 5.46k]
  ------------------
  309|  5.48k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     26|              return false;
  311|     26|            }
  312|  5.48k|          }
  313|  8.17k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  8.17k|        }
  315|  3.23k|        *oit = p_;
  316|  3.23k|        ++oit;
  317|  3.23k|        ++num_decoded_points_;
  318|  3.23k|      }
  319|  1.89k|      continue;
  320|  1.91k|    }
  321|       |
  322|  18.6k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 18.6k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  18.6k|    const int num_remaining_bits = bit_length_ - level;
  327|  18.6k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  18.6k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  18.6k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  18.6k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  18.6k|    uint32_t number = 0;
  334|  18.6k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  18.6k|    uint32_t first_half = num_remaining_points / 2;
  337|  18.6k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 53, False: 18.5k]
  ------------------
  338|       |      // Invalid |number|.
  339|     53|      return false;
  340|     53|    }
  341|  18.5k|    first_half -= number;
  342|  18.5k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  18.5k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 15.3k, False: 3.22k]
  ------------------
  345|  15.3k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 10.0k, False: 5.26k]
  ------------------
  346|  10.0k|        std::swap(first_half, second_half);
  347|  10.0k|      }
  348|  15.3k|    }
  349|       |
  350|  18.5k|    levels_stack_[stack_pos][axis] += 1;
  351|  18.5k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  18.5k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 14.1k, False: 4.41k]
  ------------------
  353|  14.1k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  14.1k|    }
  355|  18.5k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 12.0k, False: 6.53k]
  ------------------
  356|  12.0k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  12.0k|    }
  358|  18.5k|  }
  359|      7|  return true;
  360|     86|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  8.43M|        : num_remaining_points(num_remaining_points_),
  135|  8.43M|          last_axis(last_axis_),
  136|  8.43M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  8.43M|    uint32_t last_axis) {
  232|  8.43M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 8.43M, Folded]
  ------------------
  233|  8.43M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  8.43M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.40M, False: 6.02M]
  |  |  ------------------
  ------------------
  234|  8.43M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  8.43M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  4.22M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  4.22M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  4.22M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     19|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    148|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    148|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 145]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    145|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 11, False: 134]
  ------------------
  190|     11|    return false;
  191|     11|  }
  192|    134|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 133]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    133|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 14, False: 119]
  ------------------
  196|     14|    return true;
  197|     14|  }
  198|    119|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 20, False: 99]
  ------------------
  199|     20|    return false;
  200|     20|  }
  201|     99|  num_decoded_points_ = 0;
  202|       |
  203|     99|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 13, False: 86]
  ------------------
  204|     13|    return false;
  205|     13|  }
  206|     86|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 85]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     85|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 84]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     84|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 83]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     83|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 35, False: 48]
  ------------------
  217|     35|    return false;
  218|     35|  }
  219|       |
  220|     48|  numbers_decoder_.EndDecoding();
  221|     48|  remaining_bits_decoder_.EndDecoding();
  222|     48|  axis_decoder_.EndDecoding();
  223|     48|  half_decoder_.EndDecoding();
  224|       |
  225|     48|  return true;
  226|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     83|    uint32_t num_points, OutputIteratorT &oit) {
  254|     83|  typedef DecodingStatus Status;
  255|     83|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     83|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     83|  DecodingStatus init_status(num_points, 0, 0);
  258|     83|  std::stack<Status> status_stack;
  259|     83|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.67M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.67M, False: 48]
  ------------------
  263|  1.67M|    const DecodingStatus status = status_stack.top();
  264|  1.67M|    status_stack.pop();
  265|       |
  266|  1.67M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.67M|    const uint32_t last_axis = status.last_axis;
  268|  1.67M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.67M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.67M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.67M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.67M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.67M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.67M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.67M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.67M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.67M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 742k, False: 930k]
  ------------------
  285|  78.0M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 77.2M, False: 742k]
  ------------------
  286|  77.2M|        *oit = old_base;
  287|  77.2M|        ++oit;
  288|  77.2M|        ++num_decoded_points_;
  289|  77.2M|      }
  290|   742k|      continue;
  291|   742k|    }
  292|       |
  293|   930k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   930k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 64.9k, False: 865k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  64.9k|      axes_[0] = axis;
  300|   106k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 41.9k, False: 64.9k]
  ------------------
  301|  41.9k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  41.9k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 13.6k, False: 28.3k]
  |  |  ------------------
  ------------------
  302|  41.9k|      }
  303|   164k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 99.8k, False: 64.9k]
  ------------------
  304|   256k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 156k, False: 99.7k]
  ------------------
  305|   156k|          p_[axes_[j]] = 0;
  306|   156k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   156k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 133k, False: 23.0k]
  ------------------
  308|   133k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 30, False: 133k]
  ------------------
  309|   133k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     30|              return false;
  311|     30|            }
  312|   133k|          }
  313|   156k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   156k|        }
  315|  99.7k|        *oit = p_;
  316|  99.7k|        ++oit;
  317|  99.7k|        ++num_decoded_points_;
  318|  99.7k|      }
  319|  64.9k|      continue;
  320|  64.9k|    }
  321|       |
  322|   865k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 865k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   865k|    const int num_remaining_bits = bit_length_ - level;
  327|   865k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   865k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   865k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   865k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   865k|    uint32_t number = 0;
  334|   865k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   865k|    uint32_t first_half = num_remaining_points / 2;
  337|   865k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 5, False: 865k]
  ------------------
  338|       |      // Invalid |number|.
  339|      5|      return false;
  340|      5|    }
  341|   865k|    first_half -= number;
  342|   865k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   865k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 822k, False: 43.0k]
  ------------------
  345|   822k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 786k, False: 36.7k]
  ------------------
  346|   786k|        std::swap(first_half, second_half);
  347|   786k|      }
  348|   822k|    }
  349|       |
  350|   865k|    levels_stack_[stack_pos][axis] += 1;
  351|   865k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   865k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 854k, False: 11.7k]
  ------------------
  353|   854k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   854k|    }
  355|   865k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 819k, False: 46.4k]
  ------------------
  356|   819k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   819k|    }
  358|   865k|  }
  359|     48|  return true;
  360|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  1.67M|        : num_remaining_points(num_remaining_points_),
  135|  1.67M|          last_axis(last_axis_),
  136|  1.67M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|   865k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   865k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   865k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     61|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    201|      : bit_length_(0),
   87|    201|        num_points_(0),
   88|    201|        num_decoded_points_(0),
   89|    201|        dimension_(dimension),
   90|    201|        p_(dimension, 0),
   91|    201|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    201|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    201|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    143|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    143|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 140]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    140|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 133]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|    133|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 131]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    131|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 129]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|    129|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 13, False: 116]
  ------------------
  199|     13|    return false;
  200|     13|  }
  201|    116|  num_decoded_points_ = 0;
  202|       |
  203|    116|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 19, False: 97]
  ------------------
  204|     19|    return false;
  205|     19|  }
  206|     97|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 94]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     94|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 5, False: 89]
  ------------------
  210|      5|    return false;
  211|      5|  }
  212|     89|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 88]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     88|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 52, False: 36]
  ------------------
  217|     52|    return false;
  218|     52|  }
  219|       |
  220|     36|  numbers_decoder_.EndDecoding();
  221|     36|  remaining_bits_decoder_.EndDecoding();
  222|     36|  axis_decoder_.EndDecoding();
  223|     36|  half_decoder_.EndDecoding();
  224|       |
  225|     36|  return true;
  226|     88|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     88|    uint32_t num_points, OutputIteratorT &oit) {
  254|     88|  typedef DecodingStatus Status;
  255|     88|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     88|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     88|  DecodingStatus init_status(num_points, 0, 0);
  258|     88|  std::stack<Status> status_stack;
  259|     88|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.56M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.56M, False: 36]
  ------------------
  263|  2.56M|    const DecodingStatus status = status_stack.top();
  264|  2.56M|    status_stack.pop();
  265|       |
  266|  2.56M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.56M|    const uint32_t last_axis = status.last_axis;
  268|  2.56M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.56M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.56M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.56M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.56M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.56M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.56M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.56M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.56M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.56M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.11M, False: 1.44M]
  ------------------
  285|   126M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 125M, False: 1.11M]
  ------------------
  286|   125M|        *oit = old_base;
  287|   125M|        ++oit;
  288|   125M|        ++num_decoded_points_;
  289|   125M|      }
  290|  1.11M|      continue;
  291|  1.11M|    }
  292|       |
  293|  1.44M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.44M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 75.0k, False: 1.36M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  75.0k|      axes_[0] = axis;
  300|   219k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 144k, False: 75.0k]
  ------------------
  301|   144k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   144k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 12.2k, False: 132k]
  |  |  ------------------
  ------------------
  302|   144k|      }
  303|   181k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 106k, False: 74.9k]
  ------------------
  304|   454k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 348k, False: 106k]
  ------------------
  305|   348k|          p_[axes_[j]] = 0;
  306|   348k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   348k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 136k, False: 211k]
  ------------------
  308|   136k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 51, False: 136k]
  ------------------
  309|   136k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     51|              return false;
  311|     51|            }
  312|   136k|          }
  313|   348k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   348k|        }
  315|   106k|        *oit = p_;
  316|   106k|        ++oit;
  317|   106k|        ++num_decoded_points_;
  318|   106k|      }
  319|  74.9k|      continue;
  320|  75.0k|    }
  321|       |
  322|  1.36M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.36M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.36M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.36M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.36M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.36M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.36M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.36M|    uint32_t number = 0;
  334|  1.36M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.36M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.36M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.36M]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.36M|    first_half -= number;
  342|  1.36M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.36M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.34M, False: 22.4k]
  ------------------
  345|  1.34M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.28M, False: 61.6k]
  ------------------
  346|  1.28M|        std::swap(first_half, second_half);
  347|  1.28M|      }
  348|  1.34M|    }
  349|       |
  350|  1.36M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.36M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.36M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.33M, False: 33.4k]
  ------------------
  353|  1.33M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.33M|    }
  355|  1.36M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.22M, False: 137k]
  ------------------
  356|  1.22M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.22M|    }
  358|  1.36M|  }
  359|     36|  return true;
  360|     88|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.56M|        : num_remaining_points(num_remaining_points_),
  135|  2.56M|          last_axis(last_axis_),
  136|  2.56M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.56M|    uint32_t last_axis) {
  232|  2.56M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.56M, Folded]
  ------------------
  233|  2.56M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.56M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 958k, False: 1.60M]
  |  |  ------------------
  ------------------
  234|  2.56M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.56M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.36M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.36M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.36M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     38|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    132|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    132|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 128]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    128|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 122]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|    122|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 120]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    120|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 34, False: 86]
  ------------------
  196|     34|    return true;
  197|     34|  }
  198|     86|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 12, False: 74]
  ------------------
  199|     12|    return false;
  200|     12|  }
  201|     74|  num_decoded_points_ = 0;
  202|       |
  203|     74|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 34, False: 40]
  ------------------
  204|     34|    return false;
  205|     34|  }
  206|     40|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 38]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     38|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 35]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     35|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 33]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     33|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 22, False: 11]
  ------------------
  217|     22|    return false;
  218|     22|  }
  219|       |
  220|     11|  numbers_decoder_.EndDecoding();
  221|     11|  remaining_bits_decoder_.EndDecoding();
  222|     11|  axis_decoder_.EndDecoding();
  223|     11|  half_decoder_.EndDecoding();
  224|       |
  225|     11|  return true;
  226|     33|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     33|    uint32_t num_points, OutputIteratorT &oit) {
  254|     33|  typedef DecodingStatus Status;
  255|     33|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     33|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     33|  DecodingStatus init_status(num_points, 0, 0);
  258|     33|  std::stack<Status> status_stack;
  259|     33|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  87.3k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 87.3k, False: 11]
  ------------------
  263|  87.3k|    const DecodingStatus status = status_stack.top();
  264|  87.3k|    status_stack.pop();
  265|       |
  266|  87.3k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  87.3k|    const uint32_t last_axis = status.last_axis;
  268|  87.3k|    const uint32_t stack_pos = status.stack_pos;
  269|  87.3k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  87.3k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  87.3k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 87.3k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  87.3k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  87.3k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 7, False: 87.3k]
  ------------------
  278|      7|      return false;
  279|      7|    }
  280|       |
  281|  87.3k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  87.3k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 75, False: 87.2k]
  ------------------
  285|  1.07M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.07M, False: 75]
  ------------------
  286|  1.07M|        *oit = old_base;
  287|  1.07M|        ++oit;
  288|  1.07M|        ++num_decoded_points_;
  289|  1.07M|      }
  290|     75|      continue;
  291|     75|    }
  292|       |
  293|  87.2k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  87.2k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 118, False: 87.1k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    118|      axes_[0] = axis;
  300|  6.35k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 6.23k, False: 118]
  ------------------
  301|  6.23k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  6.23k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 95, False: 6.14k]
  |  |  ------------------
  ------------------
  302|  6.23k|      }
  303|    273|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 162, False: 111]
  ------------------
  304|  8.22k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 8.07k, False: 155]
  ------------------
  305|  8.07k|          p_[axes_[j]] = 0;
  306|  8.07k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  8.07k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 7.76k, False: 312]
  ------------------
  308|  7.76k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 7, False: 7.75k]
  ------------------
  309|  7.76k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      7|              return false;
  311|      7|            }
  312|  7.76k|          }
  313|  8.06k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  8.06k|        }
  315|    155|        *oit = p_;
  316|    155|        ++oit;
  317|    155|        ++num_decoded_points_;
  318|    155|      }
  319|    111|      continue;
  320|    118|    }
  321|       |
  322|  87.1k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 87.1k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  87.1k|    const int num_remaining_bits = bit_length_ - level;
  327|  87.1k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  87.1k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  87.1k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  87.1k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  87.1k|    uint32_t number = 0;
  334|  87.1k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  87.1k|    uint32_t first_half = num_remaining_points / 2;
  337|  87.1k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 8, False: 87.1k]
  ------------------
  338|       |      // Invalid |number|.
  339|      8|      return false;
  340|      8|    }
  341|  87.1k|    first_half -= number;
  342|  87.1k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  87.1k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 87.1k, False: 15]
  ------------------
  345|  87.1k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 74.5k, False: 12.6k]
  ------------------
  346|  74.5k|        std::swap(first_half, second_half);
  347|  74.5k|      }
  348|  87.1k|    }
  349|       |
  350|  87.1k|    levels_stack_[stack_pos][axis] += 1;
  351|  87.1k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  87.1k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 74.5k, False: 12.5k]
  ------------------
  353|  74.5k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  74.5k|    }
  355|  87.1k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 12.7k, False: 74.3k]
  ------------------
  356|  12.7k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  12.7k|    }
  358|  87.1k|  }
  359|     11|  return true;
  360|     33|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|  87.3k|        : num_remaining_points(num_remaining_points_),
  135|  87.3k|          last_axis(last_axis_),
  136|  87.3k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|  87.1k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  87.1k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  87.1k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     44|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    144|      : bit_length_(0),
   87|    144|        num_points_(0),
   88|    144|        num_decoded_points_(0),
   89|    144|        dimension_(dimension),
   90|    144|        p_(dimension, 0),
   91|    144|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    144|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    144|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    103|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    103|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    103|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    269|      : bit_length_(0),
   87|    269|        num_points_(0),
   88|    269|        num_decoded_points_(0),
   89|    269|        dimension_(dimension),
   90|    269|        p_(dimension, 0),
   91|    269|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    269|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    269|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    110|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    110|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    110|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    121|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    121|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    121|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    273|      : bit_length_(0),
   87|    273|        num_points_(0),
   88|    273|        num_decoded_points_(0),
   89|    273|        dimension_(dimension),
   90|    273|        p_(dimension, 0),
   91|    273|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    273|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    273|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    103|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    103|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    103|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      6|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      6|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    171|      : bit_length_(0),
   87|    171|        num_points_(0),
   88|    171|        num_decoded_points_(0),
   89|    171|        dimension_(dimension),
   90|    171|        p_(dimension, 0),
   91|    171|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    171|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    171|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      2|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      2|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.03M|    uint32_t last_axis) {
  232|  4.03M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.03M, Folded]
  ------------------
  233|  4.03M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.03M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.40M, False: 631k]
  |  |  ------------------
  ------------------
  234|  4.03M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.03M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  8.57M|    uint32_t last_axis) {
  232|  8.57M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 8.57M, Folded]
  ------------------
  233|  8.57M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  8.57M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.44M, False: 6.12M]
  |  |  ------------------
  ------------------
  234|  8.57M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  8.57M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.67M|    uint32_t last_axis) {
  232|  1.67M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.67M, Folded]
  ------------------
  233|  1.67M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.67M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.48M, False: 190k]
  |  |  ------------------
  ------------------
  234|  1.67M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  1.67M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  87.3k|    uint32_t last_axis) {
  232|  87.3k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 87.3k]
  ------------------
  233|      0|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|      0|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  234|      0|  }
  235|       |
  236|  87.3k|  uint32_t best_axis = 0;
  237|  87.3k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 87.2k, False: 64]
  ------------------
  238|  12.0M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 11.9M, False: 87.2k]
  ------------------
  239|  11.9M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 86.2k, False: 11.8M]
  ------------------
  240|  86.2k|        best_axis = axis;
  241|  86.2k|      }
  242|  11.9M|    }
  243|  87.2k|  } else {
  244|     64|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|     64|  }
  246|       |
  247|  87.3k|  return best_axis;
  248|  87.3k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    109|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    109|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    109|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    109|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    109|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 105]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    105|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 93]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|     93|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 92]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     92|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 91]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     91|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 91]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     91|  num_decoded_points_ = 0;
  202|       |
  203|     91|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 25, False: 66]
  ------------------
  204|     25|    return false;
  205|     25|  }
  206|     66|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 6, False: 60]
  ------------------
  207|      6|    return false;
  208|      6|  }
  209|     60|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 58]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     58|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 57]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     57|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 43, False: 14]
  ------------------
  217|     43|    return false;
  218|     43|  }
  219|       |
  220|     14|  numbers_decoder_.EndDecoding();
  221|     14|  remaining_bits_decoder_.EndDecoding();
  222|     14|  axis_decoder_.EndDecoding();
  223|     14|  half_decoder_.EndDecoding();
  224|       |
  225|     14|  return true;
  226|     57|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     57|    uint32_t num_points, OutputIteratorT &oit) {
  254|     57|  typedef DecodingStatus Status;
  255|     57|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     57|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     57|  DecodingStatus init_status(num_points, 0, 0);
  258|     57|  std::stack<Status> status_stack;
  259|     57|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   854k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 854k, False: 14]
  ------------------
  263|   854k|    const DecodingStatus status = status_stack.top();
  264|   854k|    status_stack.pop();
  265|       |
  266|   854k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   854k|    const uint32_t last_axis = status.last_axis;
  268|   854k|    const uint32_t stack_pos = status.stack_pos;
  269|   854k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   854k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   854k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 854k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   854k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   854k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 854k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   854k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   854k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 426k, False: 428k]
  ------------------
  285|  80.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 80.3M, False: 426k]
  ------------------
  286|  80.3M|        *oit = old_base;
  287|  80.3M|        ++oit;
  288|  80.3M|        ++num_decoded_points_;
  289|  80.3M|      }
  290|   426k|      continue;
  291|   426k|    }
  292|       |
  293|   428k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   428k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 595, False: 427k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    595|      axes_[0] = axis;
  300|  1.78k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.19k, False: 595]
  ------------------
  301|  1.19k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.19k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 246, False: 944]
  |  |  ------------------
  ------------------
  302|  1.19k|      }
  303|  1.56k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 998, False: 571]
  ------------------
  304|  3.93k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 2.95k, False: 974]
  ------------------
  305|  2.95k|          p_[axes_[j]] = 0;
  306|  2.95k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  2.95k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.67k, False: 1.28k]
  ------------------
  308|  1.67k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 24, False: 1.65k]
  ------------------
  309|  1.67k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     24|              return false;
  311|     24|            }
  312|  1.67k|          }
  313|  2.93k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.93k|        }
  315|    974|        *oit = p_;
  316|    974|        ++oit;
  317|    974|        ++num_decoded_points_;
  318|    974|      }
  319|    571|      continue;
  320|    595|    }
  321|       |
  322|   427k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 427k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   427k|    const int num_remaining_bits = bit_length_ - level;
  327|   427k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   427k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   427k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   427k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   427k|    uint32_t number = 0;
  334|   427k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   427k|    uint32_t first_half = num_remaining_points / 2;
  337|   427k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 19, False: 427k]
  ------------------
  338|       |      // Invalid |number|.
  339|     19|      return false;
  340|     19|    }
  341|   427k|    first_half -= number;
  342|   427k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   427k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 223k, False: 204k]
  ------------------
  345|   223k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 222k, False: 828]
  ------------------
  346|   222k|        std::swap(first_half, second_half);
  347|   222k|      }
  348|   223k|    }
  349|       |
  350|   427k|    levels_stack_[stack_pos][axis] += 1;
  351|   427k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   427k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 427k, False: 39]
  ------------------
  353|   427k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   427k|    }
  355|   427k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 427k, False: 74]
  ------------------
  356|   427k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   427k|    }
  358|   427k|  }
  359|     14|  return true;
  360|     57|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     85|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     85|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     85|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     85|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     85|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 84]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     84|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 74]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|     74|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 73]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     73|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 72]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     72|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 72]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     72|  num_decoded_points_ = 0;
  202|       |
  203|     72|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 12, False: 60]
  ------------------
  204|     12|    return false;
  205|     12|  }
  206|     60|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 58]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     58|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 56]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     56|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 54]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     54|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 42, False: 12]
  ------------------
  217|     42|    return false;
  218|     42|  }
  219|       |
  220|     12|  numbers_decoder_.EndDecoding();
  221|     12|  remaining_bits_decoder_.EndDecoding();
  222|     12|  axis_decoder_.EndDecoding();
  223|     12|  half_decoder_.EndDecoding();
  224|       |
  225|     12|  return true;
  226|     54|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     54|    uint32_t num_points, OutputIteratorT &oit) {
  254|     54|  typedef DecodingStatus Status;
  255|     54|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     54|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     54|  DecodingStatus init_status(num_points, 0, 0);
  258|     54|  std::stack<Status> status_stack;
  259|     54|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.89M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.89M, False: 12]
  ------------------
  263|  1.89M|    const DecodingStatus status = status_stack.top();
  264|  1.89M|    status_stack.pop();
  265|       |
  266|  1.89M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.89M|    const uint32_t last_axis = status.last_axis;
  268|  1.89M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.89M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.89M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.89M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.89M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.89M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.89M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.89M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.89M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.89M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 945k, False: 947k]
  ------------------
  285|  97.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 96.2M, False: 945k]
  ------------------
  286|  96.2M|        *oit = old_base;
  287|  96.2M|        ++oit;
  288|  96.2M|        ++num_decoded_points_;
  289|  96.2M|      }
  290|   945k|      continue;
  291|   945k|    }
  292|       |
  293|   947k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   947k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 914, False: 947k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    914|      axes_[0] = axis;
  300|  2.74k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.82k, False: 914]
  ------------------
  301|  1.82k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.82k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 199, False: 1.62k]
  |  |  ------------------
  ------------------
  302|  1.82k|      }
  303|  2.40k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.51k, False: 887]
  ------------------
  304|  6.00k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.51k, False: 1.49k]
  ------------------
  305|  4.51k|          p_[axes_[j]] = 0;
  306|  4.51k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.51k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.20k, False: 2.30k]
  ------------------
  308|  2.20k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 27, False: 2.18k]
  ------------------
  309|  2.20k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     27|              return false;
  311|     27|            }
  312|  2.20k|          }
  313|  4.48k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.48k|        }
  315|  1.49k|        *oit = p_;
  316|  1.49k|        ++oit;
  317|  1.49k|        ++num_decoded_points_;
  318|  1.49k|      }
  319|    887|      continue;
  320|    914|    }
  321|       |
  322|   947k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 947k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   947k|    const int num_remaining_bits = bit_length_ - level;
  327|   947k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   947k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   947k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   947k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   947k|    uint32_t number = 0;
  334|   947k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   947k|    uint32_t first_half = num_remaining_points / 2;
  337|   947k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 15, False: 947k]
  ------------------
  338|       |      // Invalid |number|.
  339|     15|      return false;
  340|     15|    }
  341|   947k|    first_half -= number;
  342|   947k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   947k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 486k, False: 460k]
  ------------------
  345|   486k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 486k, False: 530]
  ------------------
  346|   486k|        std::swap(first_half, second_half);
  347|   486k|      }
  348|   486k|    }
  349|       |
  350|   947k|    levels_stack_[stack_pos][axis] += 1;
  351|   947k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   947k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 947k, False: 18]
  ------------------
  353|   947k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   947k|    }
  355|   947k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 946k, False: 51]
  ------------------
  356|   946k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   946k|    }
  358|   947k|  }
  359|     12|  return true;
  360|     54|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     99|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     99|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     99|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     99|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     99|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 98]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     98|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 92]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|     92|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 91]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     91|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 90]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     90|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 90]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     90|  num_decoded_points_ = 0;
  202|       |
  203|     90|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 32, False: 58]
  ------------------
  204|     32|    return false;
  205|     32|  }
  206|     58|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 54]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     54|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 53]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     53|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 52]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     52|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 46, False: 6]
  ------------------
  217|     46|    return false;
  218|     46|  }
  219|       |
  220|      6|  numbers_decoder_.EndDecoding();
  221|      6|  remaining_bits_decoder_.EndDecoding();
  222|      6|  axis_decoder_.EndDecoding();
  223|      6|  half_decoder_.EndDecoding();
  224|       |
  225|      6|  return true;
  226|     52|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     52|    uint32_t num_points, OutputIteratorT &oit) {
  254|     52|  typedef DecodingStatus Status;
  255|     52|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     52|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     52|  DecodingStatus init_status(num_points, 0, 0);
  258|     52|  std::stack<Status> status_stack;
  259|     52|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  8.53M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 8.53M, False: 6]
  ------------------
  263|  8.53M|    const DecodingStatus status = status_stack.top();
  264|  8.53M|    status_stack.pop();
  265|       |
  266|  8.53M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  8.53M|    const uint32_t last_axis = status.last_axis;
  268|  8.53M|    const uint32_t stack_pos = status.stack_pos;
  269|  8.53M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  8.53M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  8.53M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 8.53M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  8.53M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  8.53M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 8.53M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  8.53M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  8.53M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.26M, False: 4.26M]
  ------------------
  285|  51.4M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 47.1M, False: 4.26M]
  ------------------
  286|  47.1M|        *oit = old_base;
  287|  47.1M|        ++oit;
  288|  47.1M|        ++num_decoded_points_;
  289|  47.1M|      }
  290|  4.26M|      continue;
  291|  4.26M|    }
  292|       |
  293|  4.26M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  4.26M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 384, False: 4.26M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    384|      axes_[0] = axis;
  300|  1.15k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 768, False: 384]
  ------------------
  301|    768|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    768|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 171, False: 597]
  |  |  ------------------
  ------------------
  302|    768|      }
  303|  1.01k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 646, False: 372]
  ------------------
  304|  2.55k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 1.92k, False: 634]
  ------------------
  305|  1.92k|          p_[axes_[j]] = 0;
  306|  1.92k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  1.92k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.28k, False: 634]
  ------------------
  308|  1.28k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 12, False: 1.27k]
  ------------------
  309|  1.28k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     12|              return false;
  311|     12|            }
  312|  1.28k|          }
  313|  1.91k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  1.91k|        }
  315|    634|        *oit = p_;
  316|    634|        ++oit;
  317|    634|        ++num_decoded_points_;
  318|    634|      }
  319|    372|      continue;
  320|    384|    }
  321|       |
  322|  4.26M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 4.26M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  4.26M|    const int num_remaining_bits = bit_length_ - level;
  327|  4.26M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  4.26M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  4.26M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  4.26M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  4.26M|    uint32_t number = 0;
  334|  4.26M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  4.26M|    uint32_t first_half = num_remaining_points / 2;
  337|  4.26M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 34, False: 4.26M]
  ------------------
  338|       |      // Invalid |number|.
  339|     34|      return false;
  340|     34|    }
  341|  4.26M|    first_half -= number;
  342|  4.26M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  4.26M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 766k, False: 3.50M]
  ------------------
  345|   766k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 760k, False: 5.58k]
  ------------------
  346|   760k|        std::swap(first_half, second_half);
  347|   760k|      }
  348|   766k|    }
  349|       |
  350|  4.26M|    levels_stack_[stack_pos][axis] += 1;
  351|  4.26M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  4.26M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 4.26M, False: 52]
  ------------------
  353|  4.26M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  4.26M|    }
  355|  4.26M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 4.26M, False: 77]
  ------------------
  356|  4.26M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  4.26M|    }
  358|  4.26M|  }
  359|      6|  return true;
  360|     52|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    117|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    117|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    117|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    117|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    117|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 116]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    116|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 15, False: 101]
  ------------------
  190|     15|    return false;
  191|     15|  }
  192|    101|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 99]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|     99|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 98]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     98|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 98]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     98|  num_decoded_points_ = 0;
  202|       |
  203|     98|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 33, False: 65]
  ------------------
  204|     33|    return false;
  205|     33|  }
  206|     65|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 63]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     63|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 62]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     62|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 61]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     61|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 58, False: 3]
  ------------------
  217|     58|    return false;
  218|     58|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     61|    uint32_t num_points, OutputIteratorT &oit) {
  254|     61|  typedef DecodingStatus Status;
  255|     61|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     61|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     61|  DecodingStatus init_status(num_points, 0, 0);
  258|     61|  std::stack<Status> status_stack;
  259|     61|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  8.40M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 8.40M, False: 3]
  ------------------
  263|  8.40M|    const DecodingStatus status = status_stack.top();
  264|  8.40M|    status_stack.pop();
  265|       |
  266|  8.40M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  8.40M|    const uint32_t last_axis = status.last_axis;
  268|  8.40M|    const uint32_t stack_pos = status.stack_pos;
  269|  8.40M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  8.40M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  8.40M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 8.40M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  8.40M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  8.40M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 8.40M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  8.40M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  8.40M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.20M, False: 4.20M]
  ------------------
  285|  44.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 40.5M, False: 4.20M]
  ------------------
  286|  40.5M|        *oit = old_base;
  287|  40.5M|        ++oit;
  288|  40.5M|        ++num_decoded_points_;
  289|  40.5M|      }
  290|  4.20M|      continue;
  291|  4.20M|    }
  292|       |
  293|  4.20M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  4.20M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 903, False: 4.20M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    903|      axes_[0] = axis;
  300|  2.70k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.80k, False: 903]
  ------------------
  301|  1.80k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.80k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 470, False: 1.33k]
  |  |  ------------------
  ------------------
  302|  1.80k|      }
  303|  2.44k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.55k, False: 887]
  ------------------
  304|  6.19k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.65k, False: 1.54k]
  ------------------
  305|  4.65k|          p_[axes_[j]] = 0;
  306|  4.65k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.65k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.90k, False: 744]
  ------------------
  308|  3.90k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 16, False: 3.89k]
  ------------------
  309|  3.90k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     16|              return false;
  311|     16|            }
  312|  3.90k|          }
  313|  4.63k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.63k|        }
  315|  1.54k|        *oit = p_;
  316|  1.54k|        ++oit;
  317|  1.54k|        ++num_decoded_points_;
  318|  1.54k|      }
  319|    887|      continue;
  320|    903|    }
  321|       |
  322|  4.20M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 4.20M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  4.20M|    const int num_remaining_bits = bit_length_ - level;
  327|  4.20M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  4.20M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  4.20M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  4.20M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  4.20M|    uint32_t number = 0;
  334|  4.20M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  4.20M|    uint32_t first_half = num_remaining_points / 2;
  337|  4.20M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 42, False: 4.20M]
  ------------------
  338|       |      // Invalid |number|.
  339|     42|      return false;
  340|     42|    }
  341|  4.20M|    first_half -= number;
  342|  4.20M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  4.20M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.25M, False: 2.95M]
  ------------------
  345|  1.25M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.24M, False: 1.00k]
  ------------------
  346|  1.24M|        std::swap(first_half, second_half);
  347|  1.24M|      }
  348|  1.25M|    }
  349|       |
  350|  4.20M|    levels_stack_[stack_pos][axis] += 1;
  351|  4.20M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  4.20M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 4.20M, False: 25]
  ------------------
  353|  4.20M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  4.20M|    }
  355|  4.20M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 4.20M, False: 66]
  ------------------
  356|  4.20M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  4.20M|    }
  358|  4.20M|  }
  359|      3|  return true;
  360|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     53|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     53|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     53|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     53|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 52]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     52|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 40]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|     40|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 39]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     39|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 6, False: 33]
  ------------------
  196|      6|    return true;
  197|      6|  }
  198|     33|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 33]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     33|  num_decoded_points_ = 0;
  202|       |
  203|     33|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 33, False: 0]
  ------------------
  204|     33|    return false;
  205|     33|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     28|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     28|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     28|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     28|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     28|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 27]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     27|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 9, False: 18]
  ------------------
  190|      9|    return false;
  191|      9|  }
  192|     18|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 17]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     17|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 16]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     16|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 16]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     16|  num_decoded_points_ = 0;
  202|       |
  203|     16|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 16, False: 0]
  ------------------
  204|     16|    return false;
  205|     16|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     12|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     12|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     12|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     12|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     12|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 11]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     11|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 9]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|      9|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 8]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|      8|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 7]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|      7|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 7]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      7|  num_decoded_points_ = 0;
  202|       |
  203|      7|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 7, False: 0]
  ------------------
  204|      7|    return false;
  205|      7|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}

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

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

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

_ZN5draco17PointCloudDecoderC2Ev:
   22|  13.5k|    : point_cloud_(nullptr),
   23|  13.5k|      buffer_(nullptr),
   24|  13.5k|      version_major_(0),
   25|  13.5k|      version_minor_(0),
   26|  13.5k|      options_(nullptr) {}
_ZN5draco17PointCloudDecoder12DecodeHeaderEPNS_13DecoderBufferEPNS_11DracoHeaderE:
   29|  40.6k|                                       DracoHeader *out_header) {
   30|  40.6k|  constexpr char kIoErrorMsg[] = "Failed to parse Draco header.";
   31|  40.6k|  if (!buffer->Decode(out_header->draco_string, 5)) {
  ------------------
  |  Branch (31:7): [True: 3, False: 40.6k]
  ------------------
   32|      3|    return Status(Status::IO_ERROR, kIoErrorMsg);
   33|      3|  }
   34|  40.6k|  if (memcmp(out_header->draco_string, "DRACO", 5) != 0) {
  ------------------
  |  Branch (34:7): [True: 39, False: 40.5k]
  ------------------
   35|     39|    return Status(Status::DRACO_ERROR, "Not a Draco file.");
   36|     39|  }
   37|  40.5k|  if (!buffer->Decode(&(out_header->version_major))) {
  ------------------
  |  Branch (37:7): [True: 1, False: 40.5k]
  ------------------
   38|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   39|      1|  }
   40|  40.5k|  if (!buffer->Decode(&(out_header->version_minor))) {
  ------------------
  |  Branch (40:7): [True: 1, False: 40.5k]
  ------------------
   41|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   42|      1|  }
   43|  40.5k|  if (!buffer->Decode(&(out_header->encoder_type))) {
  ------------------
  |  Branch (43:7): [True: 1, False: 40.5k]
  ------------------
   44|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   45|      1|  }
   46|  40.5k|  if (!buffer->Decode(&(out_header->encoder_method))) {
  ------------------
  |  Branch (46:7): [True: 1, False: 40.5k]
  ------------------
   47|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   48|      1|  }
   49|  40.5k|  if (!buffer->Decode(&(out_header->flags))) {
  ------------------
  |  Branch (49:7): [True: 2, False: 40.5k]
  ------------------
   50|      2|    return Status(Status::IO_ERROR, kIoErrorMsg);
   51|      2|  }
   52|  40.5k|  return OkStatus();
   53|  40.5k|}
_ZN5draco17PointCloudDecoder14DecodeMetadataEv:
   55|    726|Status PointCloudDecoder::DecodeMetadata() {
   56|    726|  std::unique_ptr<GeometryMetadata> metadata =
   57|    726|      std::unique_ptr<GeometryMetadata>(new GeometryMetadata());
   58|    726|  MetadataDecoder metadata_decoder;
   59|    726|  if (!metadata_decoder.DecodeGeometryMetadata(buffer_, metadata.get())) {
  ------------------
  |  Branch (59:7): [True: 700, False: 26]
  ------------------
   60|    700|    return Status(Status::DRACO_ERROR, "Failed to decode metadata.");
   61|    700|  }
   62|     26|  point_cloud_->AddMetadata(std::move(metadata));
   63|     26|  return OkStatus();
   64|    726|}
_ZN5draco17PointCloudDecoder6DecodeERKNS_12DracoOptionsINS_17GeometryAttribute4TypeEEEPNS_13DecoderBufferEPNS_10PointCloudE:
   68|  13.5k|                                 PointCloud *out_point_cloud) {
   69|  13.5k|  options_ = &options;
   70|  13.5k|  buffer_ = in_buffer;
   71|  13.5k|  point_cloud_ = out_point_cloud;
   72|  13.5k|  DracoHeader header;
   73|  13.5k|  DRACO_RETURN_IF_ERROR(DecodeHeader(buffer_, &header))
  ------------------
  |  |   74|  13.5k|  {                                                   \
  |  |   75|  13.5k|    const draco::Status _local_status = (expression); \
  |  |   76|  13.5k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 0, False: 13.5k]
  |  |  ------------------
  |  |   77|      0|      return _local_status;                           \
  |  |   78|      0|    }                                                 \
  |  |   79|  13.5k|  }
  ------------------
   74|       |  // Sanity check that we are really using the right decoder (mostly for cases
   75|       |  // where the Decode method was called manually outside of our main API.
   76|  13.5k|  if (header.encoder_type != GetGeometryType()) {
  ------------------
  |  Branch (76:7): [True: 0, False: 13.5k]
  ------------------
   77|      0|    return Status(Status::DRACO_ERROR,
   78|      0|                  "Using incompatible decoder for the input geometry.");
   79|      0|  }
   80|       |  // TODO(ostava): We should check the method as well, but currently decoders
   81|       |  // don't expose the decoding method id.
   82|  13.5k|  version_major_ = header.version_major;
   83|  13.5k|  version_minor_ = header.version_minor;
   84|       |
   85|  13.5k|  const uint8_t max_supported_major_version =
   86|  13.5k|      header.encoder_type == POINT_CLOUD ? kDracoPointCloudBitstreamVersionMajor
  ------------------
  |  Branch (86:7): [True: 2.14k, False: 11.3k]
  ------------------
   87|  13.5k|                                         : kDracoMeshBitstreamVersionMajor;
   88|  13.5k|  const uint8_t max_supported_minor_version =
   89|  13.5k|      header.encoder_type == POINT_CLOUD ? kDracoPointCloudBitstreamVersionMinor
  ------------------
  |  Branch (89:7): [True: 2.14k, False: 11.3k]
  ------------------
   90|  13.5k|                                         : kDracoMeshBitstreamVersionMinor;
   91|       |
   92|       |  // Check for version compatibility.
   93|  13.5k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   94|  13.5k|  if (version_major_ < 1 || version_major_ > max_supported_major_version) {
  ------------------
  |  Branch (94:7): [True: 1, False: 13.5k]
  |  Branch (94:29): [True: 8, False: 13.5k]
  ------------------
   95|      9|    return Status(Status::UNKNOWN_VERSION, "Unknown major version.");
   96|      9|  }
   97|  13.5k|  if (version_major_ == max_supported_major_version &&
  ------------------
  |  Branch (97:7): [True: 11.9k, False: 1.55k]
  ------------------
   98|  11.9k|      version_minor_ > max_supported_minor_version) {
  ------------------
  |  Branch (98:7): [True: 5, False: 11.9k]
  ------------------
   99|      5|    return Status(Status::UNKNOWN_VERSION, "Unknown minor version.");
  100|      5|  }
  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|  13.4k|  buffer_->set_bitstream_version(
  110|  13.4k|      DRACO_BITSTREAM_VERSION(version_major_, version_minor_));
  ------------------
  |  |  115|  13.4k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  111|       |
  112|  13.4k|  if (bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 3) &&
  ------------------
  |  |  115|  26.9k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (112:7): [True: 13.0k, False: 443]
  ------------------
  113|  13.0k|      (header.flags & METADATA_FLAG_MASK)) {
  ------------------
  |  |  151|  13.0k|#define METADATA_FLAG_MASK 0x8000
  ------------------
  |  Branch (113:7): [True: 726, False: 12.3k]
  ------------------
  114|    726|    DRACO_RETURN_IF_ERROR(DecodeMetadata())
  ------------------
  |  |   74|    726|  {                                                   \
  |  |   75|    726|    const draco::Status _local_status = (expression); \
  |  |   76|    726|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 700, False: 26]
  |  |  ------------------
  |  |   77|    700|      return _local_status;                           \
  |  |   78|    700|    }                                                 \
  |  |   79|    726|  }
  ------------------
  115|    726|  }
  116|  12.7k|  if (!InitializeDecoder()) {
  ------------------
  |  Branch (116:7): [True: 13, False: 12.7k]
  ------------------
  117|     13|    return Status(Status::DRACO_ERROR, "Failed to initialize the decoder.");
  118|     13|  }
  119|  12.7k|  if (!DecodeGeometryData()) {
  ------------------
  |  Branch (119:7): [True: 6.65k, False: 6.12k]
  ------------------
  120|  6.65k|    return Status(Status::DRACO_ERROR, "Failed to decode geometry data.");
  121|  6.65k|  }
  122|  6.12k|  if (!DecodePointAttributes()) {
  ------------------
  |  Branch (122:7): [True: 4.84k, False: 1.28k]
  ------------------
  123|  4.84k|    return Status(Status::DRACO_ERROR, "Failed to decode point attributes.");
  124|  4.84k|  }
  125|  1.28k|  return OkStatus();
  126|  6.12k|}
_ZN5draco17PointCloudDecoder21DecodePointAttributesEv:
  128|  6.12k|bool PointCloudDecoder::DecodePointAttributes() {
  129|  6.12k|  uint8_t num_attributes_decoders;
  130|  6.12k|  if (!buffer_->Decode(&num_attributes_decoders)) {
  ------------------
  |  Branch (130:7): [True: 172, False: 5.95k]
  ------------------
  131|    172|    return false;
  132|    172|  }
  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|  40.8k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (136:19): [True: 35.2k, False: 5.60k]
  ------------------
  137|  35.2k|    if (!CreateAttributesDecoder(i)) {
  ------------------
  |  Branch (137:9): [True: 353, False: 34.9k]
  ------------------
  138|    353|      return false;
  139|    353|    }
  140|  35.2k|  }
  141|       |
  142|       |  // Initialize all attributes decoders. No data is decoded here.
  143|  34.8k|  for (auto &att_dec : attributes_decoders_) {
  ------------------
  |  Branch (143:22): [True: 34.8k, False: 5.60k]
  ------------------
  144|  34.8k|    if (!att_dec->Init(this, point_cloud_)) {
  ------------------
  |  Branch (144:9): [True: 0, False: 34.8k]
  ------------------
  145|      0|      return false;
  146|      0|    }
  147|  34.8k|  }
  148|       |
  149|       |  // Decode any data needed by the attribute decoders.
  150|  13.1k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (150:19): [True: 7.92k, False: 5.25k]
  ------------------
  151|  7.92k|    if (!attributes_decoders_[i]->DecodeAttributesDecoderData(buffer_)) {
  ------------------
  |  Branch (151:9): [True: 350, False: 7.57k]
  ------------------
  152|    350|      return false;
  153|    350|    }
  154|  7.92k|  }
  155|       |
  156|       |  // Create map between attribute and decoder ids.
  157|  11.4k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (157:19): [True: 6.20k, False: 5.25k]
  ------------------
  158|  6.20k|    const int32_t num_attributes = attributes_decoders_[i]->GetNumAttributes();
  159|  23.8k|    for (int j = 0; j < num_attributes; ++j) {
  ------------------
  |  Branch (159:21): [True: 17.6k, False: 6.20k]
  ------------------
  160|  17.6k|      int att_id = attributes_decoders_[i]->GetAttributeId(j);
  161|  17.6k|      if (att_id >= attribute_to_decoder_map_.size()) {
  ------------------
  |  Branch (161:11): [True: 17.6k, False: 0]
  ------------------
  162|  17.6k|        attribute_to_decoder_map_.resize(att_id + 1);
  163|  17.6k|      }
  164|  17.6k|      attribute_to_decoder_map_[att_id] = i;
  165|  17.6k|    }
  166|  6.20k|  }
  167|       |
  168|       |  // Decode the actual attributes using the created attribute decoders.
  169|  5.25k|  if (!DecodeAllAttributes()) {
  ------------------
  |  Branch (169:7): [True: 3.96k, False: 1.28k]
  ------------------
  170|  3.96k|    return false;
  171|  3.96k|  }
  172|       |
  173|  1.28k|  if (!OnAttributesDecoded()) {
  ------------------
  |  Branch (173:7): [True: 0, False: 1.28k]
  ------------------
  174|      0|    return false;
  175|      0|  }
  176|  1.28k|  return true;
  177|  1.28k|}
_ZN5draco17PointCloudDecoder19DecodeAllAttributesEv:
  179|  5.25k|bool PointCloudDecoder::DecodeAllAttributes() {
  180|  5.59k|  for (auto &att_dec : attributes_decoders_) {
  ------------------
  |  Branch (180:22): [True: 5.59k, False: 1.28k]
  ------------------
  181|  5.59k|    if (!att_dec->DecodeAttributes(buffer_)) {
  ------------------
  |  Branch (181:9): [True: 3.96k, False: 1.63k]
  ------------------
  182|  3.96k|      return false;
  183|  3.96k|    }
  184|  5.59k|  }
  185|  1.28k|  return true;
  186|  5.25k|}
_ZN5draco17PointCloudDecoder20GetPortableAttributeEi:
  189|  1.75k|    int32_t parent_att_id) {
  190|  1.75k|  if (parent_att_id < 0 || parent_att_id >= point_cloud_->num_attributes()) {
  ------------------
  |  Branch (190:7): [True: 0, False: 1.75k]
  |  Branch (190:28): [True: 0, False: 1.75k]
  ------------------
  191|      0|    return nullptr;
  192|      0|  }
  193|  1.75k|  const int32_t parent_att_decoder_id =
  194|  1.75k|      attribute_to_decoder_map_[parent_att_id];
  195|  1.75k|  return attributes_decoders_[parent_att_decoder_id]->GetPortableAttribute(
  196|  1.75k|      parent_att_id);
  197|  1.75k|}

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  11.7M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  11.7M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 11.7M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  11.7M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  11.7M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   952M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   952M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 318, False: 952M]
  ------------------
   78|    318|      return false;  // Buffer overflow.
   79|    318|    }
   80|   952M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   952M|    pos_ += size_to_decode;
   82|   952M|    return true;
   83|   952M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  30.8k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  13.4k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  43.4k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   194k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  5.90k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  11.7M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.44M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  6.86k|    inline void reset(const void *b, size_t s) {
  131|  6.86k|      bit_offset_ = 0;
  132|  6.86k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  6.86k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  6.86k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  5.84k|    inline uint64_t BitsDecoded() const {
  138|  5.84k|      return static_cast<uint64_t>(bit_offset_);
  139|  5.84k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  11.7M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  11.7M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 11.7M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  11.7M|      uint32_t value = 0;
  165|  26.6M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 14.9M, False: 11.7M]
  ------------------
  166|  14.9M|        value |= GetBit() << bit;
  167|  14.9M|      }
  168|  11.7M|      *x = value;
  169|  11.7M|      return true;
  170|  11.7M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  14.9M|    inline int GetBit() {
  176|  14.9M|      const size_t off = bit_offset_;
  177|  14.9M|      const size_t byte_offset = off >> 3;
  178|  14.9M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  14.9M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 13.9M, False: 997k]
  ------------------
  180|  13.9M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  13.9M|        bit_offset_ = off + 1;
  182|  13.9M|        return bit;
  183|  13.9M|      }
  184|   997k|      return 0;
  185|  14.9M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  6.44M|  bool Decode(T *out_val) {
   69|  6.44M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 3.91k, False: 6.43M]
  ------------------
   70|  3.91k|      return false;
   71|  3.91k|    }
   72|  6.43M|    pos_ += sizeof(T);
   73|  6.43M|    return true;
   74|  6.44M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  6.44M|  bool Peek(T *out_val) {
   88|  6.44M|    const size_t size_to_decode = sizeof(T);
   89|  6.44M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 3.91k, False: 6.43M]
  ------------------
   90|  3.91k|      return false;  // Buffer overflow.
   91|  3.91k|    }
   92|  6.43M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  6.43M|    return true;
   94|  6.44M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  12.2k|  bool Decode(T *out_val) {
   69|  12.2k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 137, False: 12.0k]
  ------------------
   70|    137|      return false;
   71|    137|    }
   72|  12.0k|    pos_ += sizeof(T);
   73|  12.0k|    return true;
   74|  12.2k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  12.2k|  bool Peek(T *out_val) {
   88|  12.2k|    const size_t size_to_decode = sizeof(T);
   89|  12.2k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 137, False: 12.0k]
  ------------------
   90|    137|      return false;  // Buffer overflow.
   91|    137|    }
   92|  12.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  12.0k|    return true;
   94|  12.2k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   473k|  bool Decode(T *out_val) {
   69|   473k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 427, False: 472k]
  ------------------
   70|    427|      return false;
   71|    427|    }
   72|   472k|    pos_ += sizeof(T);
   73|   472k|    return true;
   74|   473k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   473k|  bool Peek(T *out_val) {
   88|   473k|    const size_t size_to_decode = sizeof(T);
   89|   473k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 427, False: 472k]
  ------------------
   90|    427|      return false;  // Buffer overflow.
   91|    427|    }
   92|   472k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   472k|    return true;
   94|   473k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  18.2k|  bool Decode(T *out_val) {
   69|  18.2k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 119, False: 18.1k]
  ------------------
   70|    119|      return false;
   71|    119|    }
   72|  18.1k|    pos_ += sizeof(T);
   73|  18.1k|    return true;
   74|  18.2k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  18.2k|  bool Peek(T *out_val) {
   88|  18.2k|    const size_t size_to_decode = sizeof(T);
   89|  18.2k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 119, False: 18.1k]
  ------------------
   90|    119|      return false;  // Buffer overflow.
   91|    119|    }
   92|  18.1k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  18.1k|    return true;
   94|  18.2k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   614k|  bool Decode(T *out_val) {
   69|   614k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 100, False: 614k]
  ------------------
   70|    100|      return false;
   71|    100|    }
   72|   614k|    pos_ += sizeof(T);
   73|   614k|    return true;
   74|   614k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   614k|  bool Peek(T *out_val) {
   88|   614k|    const size_t size_to_decode = sizeof(T);
   89|   614k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 100, False: 614k]
  ------------------
   90|    100|      return false;  // Buffer overflow.
   91|    100|    }
   92|   614k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   614k|    return true;
   94|   614k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  58.8k|  bool Decode(T *out_val) {
   69|  58.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 30, False: 58.7k]
  ------------------
   70|     30|      return false;
   71|     30|    }
   72|  58.7k|    pos_ += sizeof(T);
   73|  58.7k|    return true;
   74|  58.8k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  58.8k|  bool Peek(T *out_val) {
   88|  58.8k|    const size_t size_to_decode = sizeof(T);
   89|  58.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 30, False: 58.7k]
  ------------------
   90|     30|      return false;  // Buffer overflow.
   91|     30|    }
   92|  58.7k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  58.7k|    return true;
   94|  58.8k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.37k|  bool Decode(T *out_val) {
   69|  1.37k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 42, False: 1.32k]
  ------------------
   70|     42|      return false;
   71|     42|    }
   72|  1.32k|    pos_ += sizeof(T);
   73|  1.32k|    return true;
   74|  1.37k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.37k|  bool Peek(T *out_val) {
   88|  1.37k|    const size_t size_to_decode = sizeof(T);
   89|  1.37k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 42, False: 1.32k]
  ------------------
   90|     42|      return false;  // Buffer overflow.
   91|     42|    }
   92|  1.32k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.32k|    return true;
   94|  1.37k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    702|  bool Decode(T *out_val) {
   69|    702|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 7, False: 695]
  ------------------
   70|      7|      return false;
   71|      7|    }
   72|    695|    pos_ += sizeof(T);
   73|    695|    return true;
   74|    702|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    702|  bool Peek(T *out_val) {
   88|    702|    const size_t size_to_decode = sizeof(T);
   89|    702|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 7, False: 695]
  ------------------
   90|      7|      return false;  // Buffer overflow.
   91|      7|    }
   92|    695|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    695|    return true;
   94|    702|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   363M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|  4.84G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  10.3M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  10.3M|    return value_ >= val;
  100|  10.3M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   232M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  2.86G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  24.4M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   104M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   104M|    value_ = i.value_;
  153|   104M|    return *this;
  154|   104M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   967M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   967M|    value_ = i.value_;
  153|   967M|    return *this;
  154|   967M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  24.4M|  inline ThisIndexType &operator++() {
  103|  24.4M|    ++value_;
  104|  24.4M|    return *this;
  105|  24.4M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.14G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.14G|    return value_ == i.value_;
   77|  2.14G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   801M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  3.32k|  constexpr bool operator<(const IndexType &i) const {
   88|  3.32k|    return value_ < i.value_;
   89|  3.32k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   117M|  constexpr bool operator==(const IndexType &i) const {
   76|   117M|    return value_ == i.value_;
   77|   117M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   191M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   191M|    return ThisIndexType(value_ - val);
  133|   191M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   602M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   602M|    return ThisIndexType(value_ + val);
  127|   602M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  20.8M|  constexpr bool operator==(const IndexType &i) const {
   76|  20.8M|    return value_ == i.value_;
   77|  20.8M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   200M|  constexpr bool operator!=(const IndexType &i) const {
   82|   200M|    return value_ != i.value_;
   83|   200M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   332M|  constexpr bool operator!=(const IndexType &i) const {
   82|   332M|    return value_ != i.value_;
   83|   332M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   467M|  inline ThisIndexType &operator++() {
  103|   467M|    ++value_;
  104|   467M|    return *this;
  105|   467M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   353M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   353M|    value_ = i.value_;
  153|   353M|    return *this;
  154|   353M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   872M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   872M|    value_ = i.value_;
  153|   872M|    return *this;
  154|   872M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  42.1M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  42.1M|    return value_ >= val;
  100|  42.1M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  10.6M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   962M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  18.4G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   172M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  14.0G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   189M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  11.3M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  11.3M|    return ThisIndexType(value_ + val);
  127|  11.3M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   132M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  31.4M|  constexpr bool operator<(const IndexType &i) const {
   88|  31.4M|    return value_ < i.value_;
   89|  31.4M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|  4.96G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   968M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  68.1M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  4.81G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   555M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  5.81M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  5.81M|    value_ = i.value_;
  153|  5.81M|    return *this;
  154|  5.81M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  10.6M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  10.6M|    value_ += val;
  141|  10.6M|    return *this;
  142|  10.6M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  31.4M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  31.4M|    value_ = val;
  157|  31.4M|    return *this;
  158|  31.4M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   936M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  7.02M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  7.02M|  inline ThisIndexType &operator++() {
  103|  7.02M|    ++value_;
  104|  7.02M|    return *this;
  105|  7.02M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  25.4M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|  20.3M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  4.76G|  inline ThisIndexType &operator++() {
  103|  4.76G|    ++value_;
  104|  4.76G|    return *this;
  105|  4.76G|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|  20.3M|  inline ThisIndexType &operator++() {
  103|  20.3M|    ++value_;
  104|  20.3M|    return *this;
  105|  20.3M|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|  4.73G|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  4.73G|    return value_ >= val;
  100|  4.73G|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  38.1M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  38.1M|    return vector_[index.value()];
   75|  38.1M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  25.4M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  11.6k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  16.3k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  67.6M|  inline reference operator[](const IndexTypeT &index) {
   71|  67.6M|    return vector_[index.value()];
   72|  67.6M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  85.7k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  20.8M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  3.43k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   70|  10.3M|  inline reference operator[](const IndexTypeT &index) {
   71|  10.3M|    return vector_[index.value()];
   72|  10.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  25.2M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  25.2M|    return vector_[index.value()];
   75|  25.2M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   153M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  12.9M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   296M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   296M|    return vector_[index.value()];
   75|   296M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   701M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   701M|    return vector_[index.value()];
   75|   701M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   313M|  inline reference operator[](const IndexTypeT &index) {
   71|   313M|    return vector_[index.value()];
   72|   313M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  51.2M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  51.2M|    return vector_[index.value()];
   75|  51.2M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   263M|  inline reference operator[](const IndexTypeT &index) {
   71|   263M|    return vector_[index.value()];
   72|   263M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  76.2M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   169M|  inline reference operator[](const IndexTypeT &index) {
   71|   169M|    return vector_[index.value()];
   72|   169M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.08k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   159M|  inline reference operator[](const IndexTypeT &index) {
   71|   159M|    return vector_[index.value()];
   72|   159M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  55.2k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.24M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  52.2k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  6.58k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  6.58k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  6.58k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  6.58k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  12.4k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  12.4k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  12.4k|    vector_.swap(arg.vector_);
   57|  12.4k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  12.4k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  12.4k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  12.4k|    vector_.swap(arg.vector_);
   57|  12.4k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  6.58k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  6.58k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  6.58k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  11.3k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  28.9k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  56.7k|int32_t DataTypeLength(DataType dt) {
   20|  56.7k|  switch (dt) {
   21|  19.6k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 19.6k, False: 37.0k]
  ------------------
   22|  23.1k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.48k, False: 53.2k]
  ------------------
   23|  23.1k|      return 1;
   24|  3.15k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 3.15k, False: 53.5k]
  ------------------
   25|  4.43k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 1.28k, False: 55.4k]
  ------------------
   26|  4.43k|      return 2;
   27|  23.5k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 23.5k, False: 33.2k]
  ------------------
   28|  24.8k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.38k, False: 55.3k]
  ------------------
   29|  24.8k|      return 4;
   30|    156|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 156, False: 56.5k]
  ------------------
   31|    515|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 359, False: 56.3k]
  ------------------
   32|    515|      return 8;
   33|  3.45k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.45k, False: 53.2k]
  ------------------
   34|  3.45k|      return 4;
   35|    116|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 116, False: 56.6k]
  ------------------
   36|    116|      return 8;
   37|    183|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 183, False: 56.5k]
  ------------------
   38|    183|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 56.7k]
  ------------------
   40|      0|      return -1;
   41|  56.7k|  }
   42|  56.7k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  2.14k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|     10|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  11.3k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|      7|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|     56|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  13.5k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  13.5k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|     56|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  12.2k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  13.5k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.28k|  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(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|     10|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  2.14k|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  11.3k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|      7|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  11.3k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   448k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   448k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 448k, Folded]
  ------------------
   65|   448k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.47k, False: 447k]
  ------------------
   66|  1.47k|      return false;
   67|  1.47k|    }
   68|   448k|  } 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|   447k|  return true;
   77|   448k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   248k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   248k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   248k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 76, False: 248k]
  ------------------
   33|     76|    return false;
   34|     76|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   248k|  uint8_t in;
   39|   248k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 945, False: 247k]
  ------------------
   40|    945|    return false;
   41|    945|  }
   42|   247k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 20.9k, False: 226k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  20.9k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 557, False: 20.3k]
  ------------------
   45|    557|      return false;
   46|    557|    }
   47|       |    // Append decoded info from this byte.
   48|  20.3k|    *out_val <<= 7;
   49|  20.3k|    *out_val |= in & ((1 << 7) - 1);
   50|   226k|  } else {
   51|       |    // Last byte reached
   52|   226k|    *out_val = in;
   53|   226k|  }
   54|   247k|  return true;
   55|   247k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  7.56k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  7.56k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.56k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 7.55k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.55k|  uint8_t in;
   39|  7.55k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 28, False: 7.53k]
  ------------------
   40|     28|    return false;
   41|     28|  }
   42|  7.53k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 551, False: 6.97k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    551|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 34, False: 517]
  ------------------
   45|     34|      return false;
   46|     34|    }
   47|       |    // Append decoded info from this byte.
   48|    517|    *out_val <<= 7;
   49|    517|    *out_val |= in & ((1 << 7) - 1);
   50|  6.97k|  } else {
   51|       |    // Last byte reached
   52|  6.97k|    *out_val = in;
   53|  6.97k|  }
   54|  7.49k|  return true;
   55|  7.53k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  6.75k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  6.75k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 6.75k, Folded]
  ------------------
   65|  6.75k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 137, False: 6.61k]
  ------------------
   66|    137|      return false;
   67|    137|    }
   68|  6.75k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  6.61k|  return true;
   77|  6.75k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  3.91k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.91k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.91k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 3.91k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.91k|  uint8_t in;
   39|  3.91k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 35, False: 3.87k]
  ------------------
   40|     35|    return false;
   41|     35|  }
   42|  3.87k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 313, False: 3.56k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    313|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 28, False: 285]
  ------------------
   45|     28|      return false;
   46|     28|    }
   47|       |    // Append decoded info from this byte.
   48|    285|    *out_val <<= 7;
   49|    285|    *out_val |= in & ((1 << 7) - 1);
   50|  3.56k|  } else {
   51|       |    // Last byte reached
   52|  3.56k|    *out_val = in;
   53|  3.56k|  }
   54|  3.84k|  return true;
   55|  3.87k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   155k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   155k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   155k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 155k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   155k|  uint8_t in;
   39|   155k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 128, False: 155k]
  ------------------
   40|    128|    return false;
   41|    128|  }
   42|   155k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.48k, False: 151k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.48k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 73, False: 3.41k]
  ------------------
   45|     73|      return false;
   46|     73|    }
   47|       |    // Append decoded info from this byte.
   48|  3.41k|    *out_val <<= 7;
   49|  3.41k|    *out_val |= in & ((1 << 7) - 1);
   50|   151k|  } else {
   51|       |    // Last byte reached
   52|   151k|    *out_val = in;
   53|   151k|  }
   54|   155k|  return true;
   55|   155k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  3.95k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  3.95k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 3.95k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  3.95k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  3.95k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  3.95k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 51, False: 3.90k]
  ------------------
   72|     51|      return false;
   73|     51|    }
   74|  3.90k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  3.90k|  }
   76|  3.90k|  return true;
   77|  3.95k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.40k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.40k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.40k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 12, False: 4.39k]
  ------------------
   33|     12|    return false;
   34|     12|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.39k|  uint8_t in;
   39|  4.39k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 39, False: 4.35k]
  ------------------
   40|     39|    return false;
   41|     39|  }
   42|  4.35k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 454, False: 3.90k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    454|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 65, False: 389]
  ------------------
   45|     65|      return false;
   46|     65|    }
   47|       |    // Append decoded info from this byte.
   48|    389|    *out_val <<= 7;
   49|    389|    *out_val |= in & ((1 << 7) - 1);
   50|  3.90k|  } else {
   51|       |    // Last byte reached
   52|  3.90k|    *out_val = in;
   53|  3.90k|  }
   54|  4.29k|  return true;
   55|  4.35k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.32k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.32k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.32k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 3.31k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.31k|  uint8_t in;
   39|  3.31k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 18, False: 3.30k]
  ------------------
   40|     18|    return false;
   41|     18|  }
   42|  3.30k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 709, False: 2.59k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    709|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 679]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|    679|    *out_val <<= 7;
   49|    679|    *out_val |= in & ((1 << 7) - 1);
   50|  2.59k|  } else {
   51|       |    // Last byte reached
   52|  2.59k|    *out_val = in;
   53|  2.59k|  }
   54|  3.27k|  return true;
   55|  3.30k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  23.9k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  23.9k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  23.9k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 23.9k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  23.9k|  uint8_t in;
   39|  23.9k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 33, False: 23.8k]
  ------------------
   40|     33|    return false;
   41|     33|  }
   42|  23.8k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 457, False: 23.4k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    457|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 36, False: 421]
  ------------------
   45|     36|      return false;
   46|     36|    }
   47|       |    // Append decoded info from this byte.
   48|    421|    *out_val <<= 7;
   49|    421|    *out_val |= in & ((1 << 7) - 1);
   50|  23.4k|  } else {
   51|       |    // Last byte reached
   52|  23.4k|    *out_val = in;
   53|  23.4k|  }
   54|  23.8k|  return true;
   55|  23.8k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.82k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.82k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.82k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 62, False: 8.76k]
  ------------------
   33|     62|    return false;
   34|     62|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.76k|  uint8_t in;
   39|  8.76k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 92, False: 8.67k]
  ------------------
   40|     92|    return false;
   41|     92|  }
   42|  8.67k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.19k, False: 6.47k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.19k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 354, False: 1.84k]
  ------------------
   45|    354|      return false;
   46|    354|    }
   47|       |    // Append decoded info from this byte.
   48|  1.84k|    *out_val <<= 7;
   49|  1.84k|    *out_val |= in & ((1 << 7) - 1);
   50|  6.47k|  } else {
   51|       |    // Last byte reached
   52|  6.47k|    *out_val = in;
   53|  6.47k|  }
   54|  8.32k|  return true;
   55|  8.67k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  7.05k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  7.05k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.05k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 33, False: 7.02k]
  ------------------
   33|     33|    return false;
   34|     33|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.02k|  uint8_t in;
   39|  7.02k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 68, False: 6.95k]
  ------------------
   40|     68|    return false;
   41|     68|  }
   42|  6.95k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.89k, False: 3.05k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.89k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 411, False: 3.48k]
  ------------------
   45|    411|      return false;
   46|    411|    }
   47|       |    // Append decoded info from this byte.
   48|  3.48k|    *out_val <<= 7;
   49|  3.48k|    *out_val |= in & ((1 << 7) - 1);
   50|  3.48k|  } else {
   51|       |    // Last byte reached
   52|  3.05k|    *out_val = in;
   53|  3.05k|  }
   54|  6.54k|  return true;
   55|  6.95k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  32.0k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  32.0k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  32.0k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 32.0k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  32.0k|  uint8_t in;
   39|  32.0k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 61, False: 31.9k]
  ------------------
   40|     61|    return false;
   41|     61|  }
   42|  31.9k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.69k, False: 29.2k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.69k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 44, False: 2.64k]
  ------------------
   45|     44|      return false;
   46|     44|    }
   47|       |    // Append decoded info from this byte.
   48|  2.64k|    *out_val <<= 7;
   49|  2.64k|    *out_val |= in & ((1 << 7) - 1);
   50|  29.2k|  } else {
   51|       |    // Last byte reached
   52|  29.2k|    *out_val = in;
   53|  29.2k|  }
   54|  31.9k|  return true;
   55|  31.9k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   124k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   161k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  13.4k|  Self operator-(const Self &o) const {
  138|  13.4k|    Self ret;
  139|  53.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 40.4k, False: 13.4k]
  ------------------
  140|  40.4k|      ret[i] = (*this)[i] - o[i];
  141|  40.4k|    }
  142|  13.4k|    return ret;
  143|  13.4k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  33.5k|  VectorD() {
   41|   134k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 100k, False: 33.5k]
  ------------------
   42|   100k|      (*this)[i] = Scalar(0);
   43|   100k|    }
   44|  33.5k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  1.82G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|    120|      : v_({{c0, c1, c2}}) {
   60|    120|    DRACO_DCHECK_EQ(dimension, 3);
   61|    120|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   127M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  10.5M|  Self operator-(const Self &o) const {
  138|  10.5M|    Self ret;
  139|  42.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 31.5M, False: 10.5M]
  ------------------
  140|  31.5M|      ret[i] = (*this)[i] - o[i];
  141|  31.5M|    }
  142|  10.5M|    return ret;
  143|  10.5M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  5.24M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  5.24M|  static_assert(std::is_signed<ScalarT>::value,
  321|  5.24M|                "ScalarT must be a signed type. ");
  322|  5.24M|  VectorD<ScalarT, 3> r;
  323|  5.24M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  5.24M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  5.24M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  5.24M|  return r;
  327|  5.24M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  5.24M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  5.24M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.09M|  Scalar AbsSum() const {
  238|  2.09M|    Scalar result(0);
  239|  8.36M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 6.28M, False: 2.08M]
  ------------------
  240|  6.28M|      Scalar next_value = std::abs(v_[i]);
  241|  6.28M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 13.0k, False: 6.27M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  13.0k|        return std::numeric_limits<Scalar>::max();
  244|  13.0k|      }
  245|  6.27M|      result += next_value;
  246|  6.27M|    }
  247|  2.08M|    return result;
  248|  2.09M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   235k|  Self operator/(const Scalar &o) const {
  183|   235k|    Self ret;
  184|   942k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 707k, False: 235k]
  ------------------
  185|   707k|      ret[i] = (*this)[i] / o;
  186|   707k|    }
  187|   235k|    return ret;
  188|   235k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   159M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  10.0M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  6.28M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.67M|  Self operator-() const {
  121|  1.67M|    Self ret;
  122|  6.69M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 5.02M, False: 1.67M]
  ------------------
  123|  5.02M|      ret[i] = -(*this)[i];
  124|  5.02M|    }
  125|  1.67M|    return ret;
  126|  1.67M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  5.02M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   743k|  Self operator-(const Self &o) const {
  138|   743k|    Self ret;
  139|  2.23M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.48M, False: 743k]
  ------------------
  140|  1.48M|      ret[i] = (*this)[i] - o[i];
  141|  1.48M|    }
  142|   743k|    return ret;
  143|   743k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  8.92M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  13.3M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  29.3M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  1.48M|  Self operator+(const Self &o) const {
  130|  1.48M|    Self ret;
  131|  4.46M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.97M, False: 1.48M]
  ------------------
  132|  2.97M|      ret[i] = (*this)[i] + o[i];
  133|  2.97M|    }
  134|  1.48M|    return ret;
  135|  1.48M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  27.3M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   791k|  Self operator-(const Self &o) const {
  138|   791k|    Self ret;
  139|  2.37M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.58M, False: 791k]
  ------------------
  140|  1.58M|      ret[i] = (*this)[i] - o[i];
  141|  1.58M|    }
  142|   791k|    return ret;
  143|   791k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   791k|  Self operator+(const Self &o) const {
  130|   791k|    Self ret;
  131|  2.37M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.58M, False: 791k]
  ------------------
  132|  1.58M|      ret[i] = (*this)[i] + o[i];
  133|  1.58M|    }
  134|   791k|    return ret;
  135|   791k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   493k|  bool operator==(const Self &o) const {
  207|  1.46M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 982k, False: 486k]
  ------------------
  208|   982k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 6.61k, False: 975k]
  ------------------
  209|  6.61k|        return false;
  210|  6.61k|      }
  211|   982k|    }
  212|   486k|    return true;
  213|   493k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  5.92M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  6.87k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  7.13k|  Scalar Dot(const Self &o) const {
  251|  7.13k|    Scalar ret(0);
  252|  28.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 21.3k, False: 7.13k]
  ------------------
  253|  21.3k|      ret += (*this)[i] * o[i];
  254|  21.3k|    }
  255|  7.13k|    return ret;
  256|  7.13k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    260|  Self operator*(const Scalar &o) const {
  175|    260|    Self ret;
  176|  1.04k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 780, False: 260]
  ------------------
  177|    780|      ret[i] = (*this)[i] * o;
  178|    780|    }
  179|    260|    return ret;
  180|    260|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  6.61k|  Self operator-(const Self &o) const {
  138|  6.61k|    Self ret;
  139|  19.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 13.2k, False: 6.61k]
  ------------------
  140|  13.2k|      ret[i] = (*this)[i] - o[i];
  141|  13.2k|    }
  142|  6.61k|    return ret;
  143|  6.61k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  13.2k|  VectorD() {
   41|  39.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 26.4k, False: 13.2k]
  ------------------
   42|  26.4k|      (*this)[i] = Scalar(0);
   43|  26.4k|    }
   44|  13.2k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   993k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   993k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   993k|    v_[0] = c0;
   55|   993k|    v_[1] = c1;
   56|   993k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  52.8k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   327k|  bool operator==(const Self &o) const {
  207|   935k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 631k, False: 303k]
  ------------------
  208|   631k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 24.2k, False: 607k]
  ------------------
  209|  24.2k|        return false;
  210|  24.2k|      }
  211|   631k|    }
  212|   303k|    return true;
  213|   327k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.93M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  30.7M|  VectorD() {
   41|   123M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 92.3M, False: 30.7M]
  ------------------
   42|  92.3M|      (*this)[i] = Scalar(0);
   43|  92.3M|    }
   44|  30.7M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  26.8k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  29.5k|  Scalar Dot(const Self &o) const {
  251|  29.5k|    Scalar ret(0);
  252|   118k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 88.7k, False: 29.5k]
  ------------------
  253|  88.7k|      ret += (*this)[i] * o[i];
  254|  88.7k|    }
  255|  29.5k|    return ret;
  256|  29.5k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.69k|  Self operator-(const Self &o) const {
  138|  2.69k|    Self ret;
  139|  8.07k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 5.38k, False: 2.69k]
  ------------------
  140|  5.38k|      ret[i] = (*this)[i] - o[i];
  141|  5.38k|    }
  142|  2.69k|    return ret;
  143|  2.69k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  7.84k|  Self operator*(const Scalar &o) const {
  175|  7.84k|    Self ret;
  176|  23.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 15.6k, False: 7.84k]
  ------------------
  177|  15.6k|      ret[i] = (*this)[i] * o;
  178|  15.6k|    }
  179|  7.84k|    return ret;
  180|  7.84k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  2.62k|  Self operator+(const Self &o) const {
  130|  2.62k|    Self ret;
  131|  7.86k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 5.24k, False: 2.62k]
  ------------------
  132|  5.24k|      ret[i] = (*this)[i] + o[i];
  133|  5.24k|    }
  134|  2.62k|    return ret;
  135|  2.62k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.62k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.62k|  return v * o;
  294|  2.62k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.60k|  Self operator+(const Self &o) const {
  130|  2.60k|    Self ret;
  131|  10.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 7.80k, False: 2.60k]
  ------------------
  132|  7.80k|      ret[i] = (*this)[i] + o[i];
  133|  7.80k|    }
  134|  2.60k|    return ret;
  135|  2.60k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.60k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.60k|  return v * o;
  294|  2.60k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.60k|  Self operator*(const Scalar &o) const {
  175|  2.60k|    Self ret;
  176|  10.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 7.80k, False: 2.60k]
  ------------------
  177|  7.80k|      ret[i] = (*this)[i] * o;
  178|  7.80k|    }
  179|  2.60k|    return ret;
  180|  2.60k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   657k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   657k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   657k|    v_[0] = c0;
   55|   657k|    v_[1] = c1;
   56|   657k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  18.3k|  VectorD() {
   41|  55.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 36.7k, False: 18.3k]
  ------------------
   42|  36.7k|      (*this)[i] = Scalar(0);
   43|  36.7k|    }
   44|  18.3k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  5.19k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  15.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 10.3k, False: 5.19k]
  ------------------
  104|  10.3k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 10.3k, False: 0]
  ------------------
  105|  10.3k|        v_[i] = Scalar(src_vector[i]);
  106|  10.3k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  10.3k|    }
  110|  5.19k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    616|  Self operator+(const Self &o) const {
  130|    616|    Self ret;
  131|  1.84k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.23k, False: 616]
  ------------------
  132|  1.23k|      ret[i] = (*this)[i] + o[i];
  133|  1.23k|    }
  134|    616|    return ret;
  135|    616|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  2.59k|  VectorD() {
   41|  7.78k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.19k, False: 2.59k]
  ------------------
   42|  5.19k|      (*this)[i] = Scalar(0);
   43|  5.19k|    }
   44|  2.59k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  15.5k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  10.3k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  2.59k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  7.78k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 5.19k, False: 2.59k]
  ------------------
  104|  5.19k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 5.19k, False: 0]
  ------------------
  105|  5.19k|        v_[i] = Scalar(src_vector[i]);
  106|  5.19k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  5.19k|    }
  110|  2.59k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.59k|  Self operator/(const Scalar &o) const {
  183|  2.59k|    Self ret;
  184|  7.78k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 5.19k, False: 2.59k]
  ------------------
  185|  5.19k|      ret[i] = (*this)[i] / o;
  186|  5.19k|    }
  187|  2.59k|    return ret;
  188|  2.59k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.97k|  Self operator-(const Self &o) const {
  138|  1.97k|    Self ret;
  139|  5.93k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.95k, False: 1.97k]
  ------------------
  140|  3.95k|      ret[i] = (*this)[i] - o[i];
  141|  3.95k|    }
  142|  1.97k|    return ret;
  143|  1.97k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  73.3k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.67M|  VectorD() {
   41|  6.69M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.02M, False: 1.67M]
  ------------------
   42|  5.02M|      (*this)[i] = Scalar(0);
   43|  5.02M|    }
   44|  1.67M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  5.89M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  5.89M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  5.89M|    v_[0] = c0;
   55|  5.89M|    v_[1] = c1;
   56|  5.89M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  4.46M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  13.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 8.92M, False: 4.46M]
  ------------------
  104|  8.92M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 8.92M, False: 0]
  ------------------
  105|  8.92M|        v_[i] = Scalar(src_vector[i]);
  106|  8.92M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  8.92M|    }
  110|  4.46M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  2.23M|  VectorD() {
   41|  6.69M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.46M, False: 2.23M]
  ------------------
   42|  4.46M|      (*this)[i] = Scalar(0);
   43|  4.46M|    }
   44|  2.23M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  2.23M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  6.69M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 4.46M, False: 2.23M]
  ------------------
  104|  4.46M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 4.46M, False: 0]
  ------------------
  105|  4.46M|        v_[i] = Scalar(src_vector[i]);
  106|  4.46M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  4.46M|    }
  110|  2.23M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  3.62M|  VectorD(const Self &o) {
   89|  10.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 7.24M, False: 3.62M]
  ------------------
   90|  7.24M|      (*this)[i] = o[i];
   91|  7.24M|    }
   92|  3.62M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  1.58M|  VectorD() {
   41|  4.74M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.16M, False: 1.58M]
  ------------------
   42|  3.16M|      (*this)[i] = Scalar(0);
   43|  3.16M|    }
   44|  1.58M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   606M|  VectorD(const Self &o) {
   89|  2.42G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.82G, False: 606M]
  ------------------
   90|  1.82G|      (*this)[i] = o[i];
   91|  1.82G|    }
   92|   606M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  1.82G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   264M|      : v_({{c0, c1, c2}}) {
   60|   264M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   264M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  77.5M|  inline int num_vertices() const {
   74|  77.5M|    return static_cast<int>(vertex_corners_.size());
   75|  77.5M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  10.6M|  inline int num_corners() const {
   77|  10.6M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  10.6M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  2.36M|  inline int num_faces() const {
   80|  2.36M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  2.36M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   296M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   296M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 296M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   296M|    return opposite_corners_[corner];
   88|   296M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   479M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   479M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 12.3M, False: 467M]
  ------------------
   91|  12.3M|      return corner;
   92|  12.3M|    }
   93|   467M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 411M, False: 55.3M]
  ------------------
   94|   479M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   422M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   422M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 4.76M, False: 417M]
  ------------------
   97|  4.76M|      return corner;
   98|  4.76M|    }
   99|   417M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 135M, False: 282M]
  ------------------
  100|   422M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   701M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   701M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 701M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   701M|    return ConfidentVertex(corner);
  106|   701M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   701M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   701M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   701M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   701M|    return corner_to_vertex_map_[corner];
  111|   701M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  42.0M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  42.0M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 42.0M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  42.0M|    return FaceIndex(corner.value() / 3);
  117|  42.0M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   885M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  51.2M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  51.2M|    return vertex_corners_[v];
  152|  51.2M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.40M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.40M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.40M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 35.5k, False: 1.37M]
  ------------------
  188|  35.5k|      return true;
  189|  35.5k|    }
  190|  1.37M|    return false;
  191|  1.40M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  79.5M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  79.5M|    return Previous(Opposite(Previous(corner)));
  202|  79.5M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  19.2M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  19.2M|    return Next(Opposite(Next(corner)));
  207|  19.2M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  3.65M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  3.65M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 3.65M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  3.65M|    return Opposite(Previous(corner_id));
  222|  3.65M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  5.02M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  5.02M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 5.02M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  5.02M|    return Opposite(Next(corner_id));
  228|  5.02M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   263M|                                CornerIndex opp_corner_id) {
  249|   263M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   263M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   263M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   313M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   313M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   313M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   313M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  76.2M|  VertexIndex AddNewVertex() {
  271|  76.2M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  76.2M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  76.2M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  76.2M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   168M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   168M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   168M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 168M, False: 0]
  ------------------
  295|   168M|      vertex_corners_[vert] = corner;
  296|   168M|    }
  297|   168M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|   772k|  void MakeVertexIsolated(VertexIndex vert) {
  329|   772k|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|   772k|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|   772k|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  2.71k|      : corner_table_(table),
  229|  2.71k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  2.71k|        corner_(start_corner_),
  231|  2.71k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.68M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  9.70k|  VertexCornersIterator &operator++() {
  268|  9.70k|    Next();
  269|  9.70k|    return *this;
  270|  9.70k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.14M|  void Next() {
  248|  3.14M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.12M, False: 23.4k]
  ------------------
  249|  3.12M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.12M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 21.7k, False: 3.10M]
  ------------------
  251|       |        // Open boundary reached.
  252|  21.7k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  21.7k|        left_traversal_ = false;
  254|  3.10M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 517k, False: 2.58M]
  ------------------
  255|       |        // End reached.
  256|   517k|        corner_ = kInvalidCornerIndex;
  257|   517k|      }
  258|  3.12M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  23.4k|      corner_ = corner_table_->SwingRight(corner_);
  262|  23.4k|    }
  263|  3.14M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.28M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  3.66M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  4.21M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.10M|  void Next() {
  248|  2.10M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.08M, False: 22.8k]
  ------------------
  249|  2.08M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.08M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.45M, False: 627k]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.45M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.45M|        left_traversal_ = false;
  254|  1.45M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 102k, False: 525k]
  ------------------
  255|       |        // End reached.
  256|   102k|        corner_ = kInvalidCornerIndex;
  257|   102k|      }
  258|  2.08M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  22.8k|      corner_ = corner_table_->SwingRight(corner_);
  262|  22.8k|    }
  263|  2.10M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  1.55M|      : corner_table_(table),
  236|  1.55M|        start_corner_(corner_id),
  237|  1.55M|        corner_(start_corner_),
  238|  1.55M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   536k|      : corner_table_(table),
  236|   536k|        start_corner_(corner_id),
  237|   536k|        corner_(start_corner_),
  238|   536k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  60.4M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  60.4M|    return is_edge_on_seam_[corner.value()];
   47|  60.4M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  28.1M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  28.1M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 28.1M]
  |  Branch (50:42): [True: 24.1M, False: 3.96M]
  ------------------
   51|  24.1M|      return kInvalidCornerIndex;
   52|  24.1M|    }
   53|  3.96M|    return corner_table_->Opposite(corner);
   54|  28.1M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  39.0M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  39.0M|    return corner_table_->Next(corner);
   58|  39.0M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  21.1M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  21.1M|    return corner_table_->Previous(corner);
   62|  21.1M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  5.14M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  5.14M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  5.14M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.19M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.19M|    return Opposite(Previous(corner));
   73|  3.19M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  3.59M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  3.59M|    return Opposite(Next(corner));
   76|  3.59M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  4.22M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  4.22M|    return Previous(Opposite(Previous(corner)));
   81|  4.22M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  12.9M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  12.9M|    return Next(Opposite(Next(corner)));
   86|  12.9M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  8.71k|  int num_vertices() const {
   89|  8.71k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  8.71k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  2.87k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.30k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  98.2M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  98.2M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  98.2M|    return ConfidentVertex(corner);
   97|  98.2M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  98.2M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  98.2M|    return corner_to_vertex_map_[corner.value()];
  100|  98.2M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.18M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.18M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.18M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.18M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.18M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.18M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.18M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.18M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 2.78M, False: 398k]
  ------------------
  128|  2.78M|      return true;
  129|  2.78M|    }
  130|   398k|    return false;
  131|  3.18M|  }

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

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

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

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

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

_ZN5draco15MetadataDecoderC2Ev:
   23|    726|MetadataDecoder::MetadataDecoder() : buffer_(nullptr) {}
_ZN5draco15MetadataDecoder22DecodeGeometryMetadataEPNS_13DecoderBufferEPNS_16GeometryMetadataE:
   35|    726|                                             GeometryMetadata *metadata) {
   36|    726|  if (!metadata) {
  ------------------
  |  Branch (36:7): [True: 0, False: 726]
  ------------------
   37|      0|    return false;
   38|      0|  }
   39|    726|  buffer_ = in_buffer;
   40|    726|  uint32_t num_att_metadata = 0;
   41|    726|  if (!DecodeVarint(&num_att_metadata, buffer_)) {
  ------------------
  |  Branch (41:7): [True: 12, False: 714]
  ------------------
   42|     12|    return false;
   43|     12|  }
   44|       |  // Decode attribute metadata.
   45|  1.22k|  for (uint32_t i = 0; i < num_att_metadata; ++i) {
  ------------------
  |  Branch (45:24): [True: 976, False: 252]
  ------------------
   46|    976|    uint32_t att_unique_id;
   47|    976|    if (!DecodeVarint(&att_unique_id, buffer_)) {
  ------------------
  |  Branch (47:9): [True: 22, False: 954]
  ------------------
   48|     22|      return false;
   49|     22|    }
   50|    954|    std::unique_ptr<AttributeMetadata> att_metadata =
   51|    954|        std::unique_ptr<AttributeMetadata>(new AttributeMetadata());
   52|    954|    att_metadata->set_att_unique_id(att_unique_id);
   53|    954|    if (!DecodeMetadata(static_cast<Metadata *>(att_metadata.get()))) {
  ------------------
  |  Branch (53:9): [True: 440, False: 514]
  ------------------
   54|    440|      return false;
   55|    440|    }
   56|    514|    metadata->AddAttributeMetadata(std::move(att_metadata));
   57|    514|  }
   58|    252|  return DecodeMetadata(static_cast<Metadata *>(metadata));
   59|    714|}
_ZN5draco15MetadataDecoder14DecodeMetadataEPNS_8MetadataE:
   61|  1.20k|bool MetadataDecoder::DecodeMetadata(Metadata *metadata) {
   62|       |  // Limit metadata nesting depth to avoid stack overflow in destructor.
   63|  1.20k|  constexpr int kMaxSubmetadataLevel = 1000;
   64|       |
   65|  1.20k|  struct MetadataTuple {
   66|  1.20k|    Metadata *parent_metadata;
   67|  1.20k|    Metadata *decoded_metadata;
   68|  1.20k|    int level;
   69|  1.20k|  };
   70|  1.20k|  std::vector<MetadataTuple> metadata_stack;
   71|  1.20k|  metadata_stack.push_back({nullptr, metadata, 0});
   72|  34.6k|  while (!metadata_stack.empty()) {
  ------------------
  |  Branch (72:10): [True: 34.0k, False: 540]
  ------------------
   73|  34.0k|    const MetadataTuple mp = metadata_stack.back();
   74|  34.0k|    metadata_stack.pop_back();
   75|  34.0k|    metadata = mp.decoded_metadata;
   76|       |
   77|  34.0k|    if (mp.parent_metadata != nullptr) {
  ------------------
  |  Branch (77:9): [True: 32.8k, False: 1.20k]
  ------------------
   78|  32.8k|      if (mp.level > kMaxSubmetadataLevel) {
  ------------------
  |  Branch (78:11): [True: 3, False: 32.8k]
  ------------------
   79|      3|        return false;
   80|      3|      }
   81|  32.8k|      std::string sub_metadata_name;
   82|  32.8k|      if (!DecodeName(&sub_metadata_name)) {
  ------------------
  |  Branch (82:11): [True: 48, False: 32.8k]
  ------------------
   83|     48|        return false;
   84|     48|      }
   85|  32.8k|      std::unique_ptr<Metadata> sub_metadata =
   86|  32.8k|          std::unique_ptr<Metadata>(new Metadata());
   87|  32.8k|      metadata = sub_metadata.get();
   88|  32.8k|      if (!mp.parent_metadata->AddSubMetadata(sub_metadata_name,
  ------------------
  |  Branch (88:11): [True: 17, False: 32.7k]
  ------------------
   89|  32.8k|                                              std::move(sub_metadata))) {
   90|     17|        return false;
   91|     17|      }
   92|  32.8k|    }
   93|  34.0k|    if (metadata == nullptr) {
  ------------------
  |  Branch (93:9): [True: 0, False: 34.0k]
  ------------------
   94|      0|      return false;
   95|      0|    }
   96|       |
   97|  34.0k|    uint32_t num_entries = 0;
   98|  34.0k|    if (!DecodeVarint(&num_entries, buffer_)) {
  ------------------
  |  Branch (98:9): [True: 35, False: 33.9k]
  ------------------
   99|     35|      return false;
  100|     35|    }
  101|   116k|    for (uint32_t i = 0; i < num_entries; ++i) {
  ------------------
  |  Branch (101:26): [True: 82.9k, False: 33.5k]
  ------------------
  102|  82.9k|      if (!DecodeEntry(metadata)) {
  ------------------
  |  Branch (102:11): [True: 462, False: 82.5k]
  ------------------
  103|    462|        return false;
  104|    462|      }
  105|  82.9k|    }
  106|  33.5k|    uint32_t num_sub_metadata = 0;
  107|  33.5k|    if (!DecodeVarint(&num_sub_metadata, buffer_)) {
  ------------------
  |  Branch (107:9): [True: 19, False: 33.4k]
  ------------------
  108|     19|      return false;
  109|     19|    }
  110|  33.4k|    if (num_sub_metadata > buffer_->remaining_size()) {
  ------------------
  |  Branch (110:9): [True: 82, False: 33.4k]
  ------------------
  111|       |      // The decoded number of metadata items is unreasonably high.
  112|     82|      return false;
  113|     82|    }
  114|   546k|    for (uint32_t i = 0; i < num_sub_metadata; ++i) {
  ------------------
  |  Branch (114:26): [True: 512k, False: 33.4k]
  ------------------
  115|   512k|      metadata_stack.push_back(
  116|   512k|          {metadata, nullptr, mp.parent_metadata ? mp.level + 1 : mp.level});
  ------------------
  |  Branch (116:31): [True: 503k, False: 9.16k]
  ------------------
  117|   512k|    }
  118|  33.4k|  }
  119|    540|  return true;
  120|  1.20k|}
_ZN5draco15MetadataDecoder11DecodeEntryEPNS_8MetadataE:
  122|  82.9k|bool MetadataDecoder::DecodeEntry(Metadata *metadata) {
  123|  82.9k|  std::string entry_name;
  124|  82.9k|  if (!DecodeName(&entry_name)) {
  ------------------
  |  Branch (124:7): [True: 226, False: 82.7k]
  ------------------
  125|    226|    return false;
  126|    226|  }
  127|  82.7k|  uint32_t data_size = 0;
  128|  82.7k|  if (!DecodeVarint(&data_size, buffer_)) {
  ------------------
  |  Branch (128:7): [True: 49, False: 82.6k]
  ------------------
  129|     49|    return false;
  130|     49|  }
  131|  82.6k|  if (data_size == 0) {
  ------------------
  |  Branch (131:7): [True: 69, False: 82.6k]
  ------------------
  132|     69|    return false;
  133|     69|  }
  134|  82.6k|  if (data_size > buffer_->remaining_size()) {
  ------------------
  |  Branch (134:7): [True: 118, False: 82.5k]
  ------------------
  135|    118|    return false;
  136|    118|  }
  137|  82.5k|  std::vector<uint8_t> entry_value(data_size);
  138|  82.5k|  if (!buffer_->Decode(&entry_value[0], data_size)) {
  ------------------
  |  Branch (138:7): [True: 0, False: 82.5k]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|  82.5k|  metadata->AddEntryBinary(entry_name, entry_value);
  142|  82.5k|  return true;
  143|  82.5k|}
_ZN5draco15MetadataDecoder10DecodeNameEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  145|   115k|bool MetadataDecoder::DecodeName(std::string *name) {
  146|   115k|  uint8_t name_len = 0;
  147|   115k|  if (!buffer_->Decode(&name_len)) {
  ------------------
  |  Branch (147:7): [True: 84, False: 115k]
  ------------------
  148|     84|    return false;
  149|     84|  }
  150|   115k|  name->resize(name_len);
  151|   115k|  if (name_len == 0) {
  ------------------
  |  Branch (151:7): [True: 16.0k, False: 99.7k]
  ------------------
  152|  16.0k|    return true;
  153|  16.0k|  }
  154|  99.7k|  if (!buffer_->Decode(&name->at(0), name_len)) {
  ------------------
  |  Branch (154:7): [True: 190, False: 99.5k]
  ------------------
  155|    190|    return false;
  156|    190|  }
  157|  99.5k|  return true;
  158|  99.7k|}

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

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

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

