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

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

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

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

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

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

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

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

_ZNK5draco17GeometryAttribute10GetBytePosENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  118|  3.90M|  inline int64_t GetBytePos(AttributeValueIndex att_index) const {
  119|  3.90M|    return byte_offset_ + byte_stride_ * att_index.value();
  120|  3.90M|  }
_ZNK5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  122|  3.89M|  inline const uint8_t *GetAddress(AttributeValueIndex att_index) const {
  123|  3.89M|    const int64_t byte_pos = GetBytePos(att_index);
  124|  3.89M|    return buffer_->data() + byte_pos;
  125|  3.89M|  }
_ZN5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  126|  1.12k|  inline uint8_t *GetAddress(AttributeValueIndex att_index) {
  127|  1.12k|    const int64_t byte_pos = GetBytePos(att_index);
  128|  1.12k|    return buffer_->data() + byte_pos;
  129|  1.12k|  }
_ZNK5draco17GeometryAttribute14IsAddressValidEPKh:
  130|  11.6M|  inline bool IsAddressValid(const uint8_t *address) const {
  131|  11.6M|    return ((buffer_->data() + buffer_->data_size()) > address);
  132|  11.6M|  }
_ZNK5draco17GeometryAttribute8GetValueENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPv:
  136|    238|  void GetValue(AttributeValueIndex att_index, void *out_data) const {
  137|    238|    const int64_t byte_pos = byte_offset_ + byte_stride_ * att_index.value();
  138|    238|    buffer_->Read(byte_pos, out_data, byte_stride_);
  139|    238|  }
_ZN5draco17GeometryAttribute17SetAttributeValueENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPKv:
  143|   140M|  void SetAttributeValue(AttributeValueIndex entry_index, const void *value) {
  144|   140M|    const int64_t byte_pos = entry_index.value() * byte_stride();
  145|   140M|    buffer_->Write(byte_pos, value, byte_stride());
  146|   140M|  }
_ZNK5draco17GeometryAttribute14attribute_typeEv:
  266|  14.0k|  Type attribute_type() const { return attribute_type_; }
_ZNK5draco17GeometryAttribute9data_typeEv:
  269|  5.27k|  DataType data_type() const { return data_type_; }
_ZNK5draco17GeometryAttribute14num_componentsEv:
  273|  57.7k|  uint8_t num_components() const { return num_components_; }
_ZNK5draco17GeometryAttribute11byte_strideEv:
  282|   280M|  int64_t byte_stride() const { return byte_stride_; }
_ZNK5draco17GeometryAttribute9unique_idEv:
  287|    995|  uint32_t unique_id() const { return unique_id_; }
_ZN5draco17GeometryAttribute13set_unique_idEj:
  288|  19.7k|  void set_unique_id(uint32_t id) { unique_id_ = id; }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  3.89M|  bool ConvertValue(AttributeValueIndex att_index, OutT *out_value) const {
  230|  3.89M|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  3.89M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  3.89M|                    OutT *out_val) const {
  180|  3.89M|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 3.89M]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  3.89M|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 3.89M]
  ------------------
  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: 3.89M]
  ------------------
  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: 3.89M]
  ------------------
  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: 3.89M]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  3.89M|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 3.89M, False: 0]
  ------------------
  197|  3.89M|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  3.89M|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 3.89M]
  ------------------
  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: 3.89M]
  ------------------
  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: 3.89M]
  ------------------
  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: 3.89M]
  ------------------
  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: 3.89M]
  ------------------
  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: 3.89M]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 3.89M]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  3.89M|    }
  221|  3.89M|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIilEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  3.89M|                         OutT *out_value) const {
  307|  3.89M|    const uint8_t *src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|  15.5M|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 11.6M, False: 3.89M]
  ------------------
  311|  11.6M|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 11.6M]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  11.6M|      const T in_value = *reinterpret_cast<const T *>(src_address);
  315|  11.6M|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 11.6M]
  ------------------
  316|  11.6M|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  11.6M|      src_address += sizeof(T);
  320|  11.6M|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  3.89M|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 3.89M]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  3.89M|    return true;
  326|  3.89M|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIilEEbRKT_bPT0_:
  364|  11.6M|                                    OutT *out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  11.6M|    if (std::is_integral<OutT>::value) {
  ------------------
  |  Branch (366:9): [True: 11.6M, 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|  11.6M|      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|  11.6M|        static constexpr OutT kOutMin =
  371|  11.6M|            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  ------------------
  |  Branch (371:13): [True: 0, Folded]
  ------------------
  372|  11.6M|        if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (372:13): [True: 0, False: 11.6M]
  |  Branch (372:35): [True: 0, False: 11.6M]
  ------------------
  373|      0|          return false;
  374|      0|        }
  375|  11.6M|      }
  376|       |
  377|       |      // Check conversion of floating point |in_value| to integral value OutT.
  378|  11.6M|      if (std::is_floating_point<T>::value) {
  ------------------
  |  Branch (378:11): [Folded, False: 11.6M]
  ------------------
  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|  11.6M|    }
  406|       |
  407|  11.6M|    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|  11.6M|    } else if (std::is_floating_point<T>::value &&
  ------------------
  |  Branch (413:16): [Folded, False: 11.6M]
  ------------------
  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|  11.6M|    } else {
  433|  11.6M|      *out_value = static_cast<OutT>(in_value);
  434|  11.6M|    }
  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|  11.6M|    return true;
  442|  11.6M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|     96|  bool ConvertValue(AttributeValueIndex att_index, OutT *out_value) const {
  230|     96|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|     96|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|     96|                    OutT *out_val) const {
  180|     96|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 96]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|     96|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 96]
  ------------------
  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: 96]
  ------------------
  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: 96]
  ------------------
  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: 96]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|     96|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 96, False: 0]
  ------------------
  197|     96|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|     96|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 96]
  ------------------
  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: 96]
  ------------------
  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: 96]
  ------------------
  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: 96]
  ------------------
  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: 96]
  ------------------
  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: 96]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 96]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|     96|    }
  221|     96|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIifEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|     96|                         OutT *out_value) const {
  307|     96|    const uint8_t *src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|    384|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 288, False: 96]
  ------------------
  311|    288|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 288]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|    288|      const T in_value = *reinterpret_cast<const T *>(src_address);
  315|    288|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 288]
  ------------------
  316|    288|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|    288|      src_address += sizeof(T);
  320|    288|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|     96|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 96]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|     96|    return true;
  326|     96|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIifEEbRKT_bPT0_:
  364|    288|                                    OutT *out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|    288|    if (std::is_integral<OutT>::value) {
  ------------------
  |  Branch (366:9): [Folded, False: 288]
  ------------------
  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|    288|    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|    288|        normalized) {
  ------------------
  |  Branch (408:9): [True: 0, False: 288]
  ------------------
  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|    288|    } else if (std::is_floating_point<T>::value &&
  ------------------
  |  Branch (413:16): [Folded, False: 288]
  ------------------
  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|    288|    } else {
  433|    288|      *out_value = static_cast<OutT>(in_value);
  434|    288|    }
  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|    288|    return true;
  442|    288|  }

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|    383|      : quantization_bits_(-1),
   54|    383|        max_quantized_value_(-1),
   55|    383|        max_value_(-1),
   56|    383|        dequantization_scale_(1.f),
   57|    383|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|    342|  bool SetQuantizationBits(int32_t q) {
   60|    342|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 198, False: 144]
  |  Branch (60:18): [True: 17, False: 127]
  ------------------
   61|    215|      return false;
   62|    215|    }
   63|    127|    quantization_bits_ = q;
   64|    127|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|    127|    max_value_ = max_quantized_value_ - 1;
   66|    127|    dequantization_scale_ = 2.f / max_value_;
   67|    127|    center_value_ = max_value_ / 2;
   68|    127|    return true;
   69|    342|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|   325k|                                           int32_t *out_t) const {
   77|   325k|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2.92k, False: 322k]
  |  Branch (77:20): [True: 0, False: 2.92k]
  |  Branch (77:32): [True: 2.92k, False: 322k]
  |  Branch (77:42): [True: 0, False: 2.92k]
  ------------------
   78|   325k|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 76.5k, False: 249k]
  |  Branch (78:29): [True: 3.02k, False: 73.5k]
  ------------------
   79|  3.02k|      s = max_value_;
   80|  3.02k|      t = max_value_;
   81|   322k|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.92k, False: 319k]
  |  Branch (81:26): [True: 860, False: 2.06k]
  ------------------
   82|    860|      t = center_value_ - (t - center_value_);
   83|   321k|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 73.5k, False: 248k]
  |  Branch (83:35): [True: 3.27k, False: 70.2k]
  ------------------
   84|  3.27k|      t = center_value_ + (center_value_ - t);
   85|   318k|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 71.9k, False: 246k]
  |  Branch (85:35): [True: 344, False: 71.6k]
  ------------------
   86|    344|      s = center_value_ + (center_value_ - s);
   87|   318k|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 3.87k, False: 314k]
  |  Branch (87:26): [True: 1.47k, False: 2.40k]
  ------------------
   88|  1.47k|      s = center_value_ - (s - center_value_);
   89|  1.47k|    }
   90|       |
   91|   325k|    *out_s = s;
   92|   325k|    *out_t = t;
   93|   325k|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|   325k|                                                       int32_t *out_t) const {
  100|   325k|    DRACO_DCHECK_EQ(
  101|   325k|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|   325k|        center_value_);
  103|   325k|    int32_t s, t;
  104|   325k|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 162k, False: 163k]
  ------------------
  105|       |      // Right hemisphere.
  106|   162k|      s = (int_vec[1] + center_value_);
  107|   162k|      t = (int_vec[2] + center_value_);
  108|   163k|    } else {
  109|       |      // Left hemisphere.
  110|   163k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 50.9k, False: 112k]
  ------------------
  111|  50.9k|        s = std::abs(int_vec[2]);
  112|   112k|      } else {
  113|   112k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   112k|      }
  115|   163k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 55.8k, False: 107k]
  ------------------
  116|  55.8k|        t = std::abs(int_vec[1]);
  117|   107k|      } else {
  118|   107k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   107k|      }
  120|   163k|    }
  121|   325k|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|   325k|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|     98|                                                    float *out_vector) const {
  199|     98|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|     98|                                 in_t * dequantization_scale_ - 1.f,
  201|     98|                                 out_vector);
  202|     98|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|   296k|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|   296k|    DRACO_DCHECK_LE(s, center_value_);
  208|   296k|    DRACO_DCHECK_LE(t, center_value_);
  209|   296k|    DRACO_DCHECK_GE(s, -center_value_);
  210|   296k|    DRACO_DCHECK_GE(t, -center_value_);
  211|   296k|    const uint32_t st =
  212|   296k|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|   296k|    return st <= center_value_;
  214|   296k|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|   324k|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|   324k|    DRACO_DCHECK_LE(*s, center_value_);
  219|   324k|    DRACO_DCHECK_LE(*t, center_value_);
  220|   324k|    DRACO_DCHECK_GE(*s, -center_value_);
  221|   324k|    DRACO_DCHECK_GE(*t, -center_value_);
  222|   324k|    int32_t sign_s = 0;
  223|   324k|    int32_t sign_t = 0;
  224|   324k|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 221k, False: 103k]
  |  Branch (224:20): [True: 154k, False: 66.4k]
  ------------------
  225|   154k|      sign_s = 1;
  226|   154k|      sign_t = 1;
  227|   169k|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 104k, False: 64.9k]
  |  Branch (227:27): [True: 47.8k, False: 57.0k]
  ------------------
  228|  47.8k|      sign_s = -1;
  229|  47.8k|      sign_t = -1;
  230|   122k|    } else {
  231|   122k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 64.9k, False: 57.0k]
  ------------------
  232|   122k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 57.0k, False: 64.9k]
  ------------------
  233|   122k|    }
  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|   324k|    const uint32_t corner_point_s = sign_s * center_value_;
  239|   324k|    const uint32_t corner_point_t = sign_t * center_value_;
  240|   324k|    uint32_t us = *s;
  241|   324k|    uint32_t ut = *t;
  242|   324k|    us = us + us - corner_point_s;
  243|   324k|    ut = ut + ut - corner_point_t;
  244|   324k|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 202k, False: 122k]
  ------------------
  245|   202k|      uint32_t temp = us;
  246|   202k|      us = -ut;
  247|   202k|      ut = -temp;
  248|   202k|    } else {
  249|   122k|      std::swap(us, ut);
  250|   122k|    }
  251|   324k|    us = us + corner_point_s;
  252|   324k|    ut = ut + corner_point_t;
  253|       |
  254|   324k|    *s = us;
  255|   324k|    *t = ut;
  256|   324k|    *s /= 2;
  257|   324k|    *t /= 2;
  258|   324k|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|   593k|  int32_t ModMax(int32_t x) const {
  273|   593k|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 0, False: 593k]
  ------------------
  274|      0|      return x - this->max_quantized_value();
  275|      0|    }
  276|   593k|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 0, False: 593k]
  ------------------
  277|      0|      return x + this->max_quantized_value();
  278|      0|    }
  279|   593k|    return x;
  280|   593k|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|    138|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  1.77M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|     98|                                           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|     98|    float y = in_s_scaled;
  329|     98|    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|     98|    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|     98|    float x_offset = -x;
  342|     98|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 0, False: 98]
  ------------------
  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|     98|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 0, False: 98]
  ------------------
  348|     98|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 1, False: 97]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|     98|    const float norm_squared = x * x + y * y + z * z;
  352|     98|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 98]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|     98|    } else {
  357|     98|      const float d = 1.0f / std::sqrt(norm_squared);
  358|     98|      out_vector[0] = x * d;
  359|     98|      out_vector[1] = y * d;
  360|     98|      out_vector[2] = z * d;
  361|     98|    }
  362|     98|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|   325k|  void CanonicalizeIntegerVector(T *vec) const {
  174|   325k|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|   325k|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|   325k|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|   325k|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|   325k|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|   325k|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 66.8k, False: 258k]
  ------------------
  181|  66.8k|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|   258k|    } else {
  183|   258k|      vec[0] =
  184|   258k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   258k|          abs_sum;
  186|   258k|      vec[1] =
  187|   258k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   258k|          abs_sum;
  189|   258k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 136k, False: 122k]
  ------------------
  190|   136k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   136k|      } else {
  192|   122k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   122k|      }
  194|   258k|    }
  195|   325k|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|     47|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|     47|            attribute, transform, mesh_data),
   52|     47|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|     39|                                                                *buffer) {
  194|     39|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|     39|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     39|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 7, False: 32]
  ------------------
  196|       |    // Decode prediction mode.
  197|      7|    uint8_t mode;
  198|      7|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 7]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      7|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 6, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      6|      return false;
  205|      6|    }
  206|      7|  }
  207|     33|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    142|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 116, False: 26]
  ------------------
  211|    116|    uint32_t num_flags;
  212|    116|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 1, False: 115]
  ------------------
  213|      1|      return false;
  214|      1|    }
  215|    115|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 3, False: 112]
  ------------------
  216|      3|      return false;
  217|      3|    }
  218|    112|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 79, False: 33]
  ------------------
  219|     79|      is_crease_edge_[i].resize(num_flags);
  220|     79|      RAnsBitDecoder decoder;
  221|     79|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 3, False: 76]
  ------------------
  222|      3|        return false;
  223|      3|      }
  224|  1.41k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.34k, False: 76]
  ------------------
  225|  1.34k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.34k|      }
  227|     76|      decoder.EndDecoding();
  228|     76|    }
  229|    112|  }
  230|     26|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|     26|                                     MeshDataT>::DecodePredictionData(buffer);
  232|     33|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|     26|                          const PointIndex * /* entry_to_point_id_map */) {
   87|     26|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|     26|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    130|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 104, False: 26]
  ------------------
   93|    104|    pred_vals[i].resize(num_components, 0);
   94|    104|  }
   95|     26|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|     26|                                         out_data);
   97|       |
   98|     26|  const CornerTable *const table = this->mesh_data().corner_table();
   99|     26|  const std::vector<int32_t> *const vertex_to_data_map =
  100|     26|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|     26|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|     26|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|     26|  const int corner_map_size =
  109|     26|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  3.07k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 3.05k, False: 15]
  ------------------
  111|  3.05k|    const CornerIndex start_corner_id =
  112|  3.05k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  3.05k|    CornerIndex corner_id(start_corner_id);
  115|  3.05k|    int num_parallelograms = 0;
  116|  3.05k|    bool first_pass = true;
  117|  7.28k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 4.32k, False: 2.96k]
  ------------------
  118|  4.32k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 423, False: 3.89k]
  ------------------
  119|  4.32k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  4.32k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|    423|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|    423|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 0, False: 423]
  ------------------
  127|      0|          break;
  128|      0|        }
  129|    423|      }
  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|  4.32k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 3.76k, False: 558]
  ------------------
  134|  3.76k|        corner_id = table->SwingLeft(corner_id);
  135|  3.76k|      } else {
  136|    558|        corner_id = table->SwingRight(corner_id);
  137|    558|      }
  138|  4.32k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 88, False: 4.23k]
  ------------------
  139|     88|        break;
  140|     88|      }
  141|  4.23k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 3.42k, False: 807]
  |  Branch (141:47): [True: 2.96k, False: 460]
  ------------------
  142|  2.96k|        first_pass = false;
  143|  2.96k|        corner_id = table->SwingRight(start_corner_id);
  144|  2.96k|      }
  145|  4.23k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  3.05k|    int num_used_parallelograms = 0;
  150|  3.05k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 423, False: 2.63k]
  ------------------
  151|  3.86k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 3.43k, False: 423]
  ------------------
  152|  3.43k|        multi_pred_vals[i] = 0;
  153|  3.43k|      }
  154|       |      // Check which parallelograms are actually used.
  155|    835|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 423, False: 412]
  ------------------
  156|    423|        const int context = num_parallelograms - 1;
  157|    423|        const int pos = is_crease_edge_pos[context]++;
  158|    423|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 11, False: 412]
  ------------------
  159|     11|          return false;
  160|     11|        }
  161|    412|        const bool is_crease = is_crease_edge_[context][pos];
  162|    412|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 6, False: 406]
  ------------------
  163|      6|          ++num_used_parallelograms;
  164|  1.53k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.53k, False: 6]
  ------------------
  165|  1.53k|            multi_pred_vals[j] =
  166|  1.53k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.53k|          }
  168|      6|        }
  169|    412|      }
  170|    423|    }
  171|  3.04k|    const int dst_offset = p * num_components;
  172|  3.04k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 3.03k, False: 6]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  3.03k|      const int src_offset = (p - 1) * num_components;
  176|  3.03k|      this->transform().ComputeOriginalValue(
  177|  3.03k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  3.03k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  1.53k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 1.53k, False: 6]
  ------------------
  181|  1.53k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  1.53k|      }
  183|      6|      this->transform().ComputeOriginalValue(
  184|      6|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|      6|    }
  186|  3.04k|  }
  187|     15|  return true;
  188|     26|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|     35|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|     35|            attribute, transform, mesh_data),
   52|     35|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|     34|                                                                *buffer) {
  194|     34|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|     34|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     34|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 34]
  ------------------
  196|       |    // Decode prediction mode.
  197|      0|    uint8_t mode;
  198|      0|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      0|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 0, False: 0]
  ------------------
  203|       |      // Unsupported mode.
  204|      0|      return false;
  205|      0|    }
  206|      0|  }
  207|     34|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    156|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 127, False: 29]
  ------------------
  211|    127|    uint32_t num_flags;
  212|    127|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 2, False: 125]
  ------------------
  213|      2|      return false;
  214|      2|    }
  215|    125|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 1, False: 124]
  ------------------
  216|      1|      return false;
  217|      1|    }
  218|    124|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 96, False: 28]
  ------------------
  219|     96|      is_crease_edge_[i].resize(num_flags);
  220|     96|      RAnsBitDecoder decoder;
  221|     96|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 2, False: 94]
  ------------------
  222|      2|        return false;
  223|      2|      }
  224|  24.4k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 24.3k, False: 94]
  ------------------
  225|  24.3k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  24.3k|      }
  227|     94|      decoder.EndDecoding();
  228|     94|    }
  229|    124|  }
  230|     29|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|     29|                                     MeshDataT>::DecodePredictionData(buffer);
  232|     34|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|     24|                          const PointIndex * /* entry_to_point_id_map */) {
   87|     24|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|     24|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    120|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 96, False: 24]
  ------------------
   93|     96|    pred_vals[i].resize(num_components, 0);
   94|     96|  }
   95|     24|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|     24|                                         out_data);
   97|       |
   98|     24|  const CornerTable *const table = this->mesh_data().corner_table();
   99|     24|  const std::vector<int32_t> *const vertex_to_data_map =
  100|     24|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|     24|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|     24|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|     24|  const int corner_map_size =
  109|     24|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  5.75k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 5.74k, False: 9]
  ------------------
  111|  5.74k|    const CornerIndex start_corner_id =
  112|  5.74k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  5.74k|    CornerIndex corner_id(start_corner_id);
  115|  5.74k|    int num_parallelograms = 0;
  116|  5.74k|    bool first_pass = true;
  117|  30.9k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 30.0k, False: 910]
  ------------------
  118|  30.0k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 9.14k, False: 20.9k]
  ------------------
  119|  30.0k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  30.0k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  9.14k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  9.14k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 4, False: 9.14k]
  ------------------
  127|      4|          break;
  128|      4|        }
  129|  9.14k|      }
  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|  30.0k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 29.3k, False: 732]
  ------------------
  134|  29.3k|        corner_id = table->SwingLeft(corner_id);
  135|  29.3k|      } else {
  136|    732|        corner_id = table->SwingRight(corner_id);
  137|    732|      }
  138|  30.0k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 4.83k, False: 25.2k]
  ------------------
  139|  4.83k|        break;
  140|  4.83k|      }
  141|  25.2k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.26k, False: 23.9k]
  |  Branch (141:47): [True: 914, False: 347]
  ------------------
  142|    914|        first_pass = false;
  143|    914|        corner_id = table->SwingRight(start_corner_id);
  144|    914|      }
  145|  25.2k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  5.74k|    int num_used_parallelograms = 0;
  150|  5.74k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 4.86k, False: 882]
  ------------------
  151|   573k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 569k, False: 4.86k]
  ------------------
  152|   569k|        multi_pred_vals[i] = 0;
  153|   569k|      }
  154|       |      // Check which parallelograms are actually used.
  155|  13.9k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 9.13k, False: 4.84k]
  ------------------
  156|  9.13k|        const int context = num_parallelograms - 1;
  157|  9.13k|        const int pos = is_crease_edge_pos[context]++;
  158|  9.13k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 15, False: 9.11k]
  ------------------
  159|     15|          return false;
  160|     15|        }
  161|  9.11k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  9.11k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 8.41k, False: 702]
  ------------------
  163|  8.41k|          ++num_used_parallelograms;
  164|  1.02M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.01M, False: 8.41k]
  ------------------
  165|  1.01M|            multi_pred_vals[j] =
  166|  1.01M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.01M|          }
  168|  8.41k|        }
  169|  9.11k|      }
  170|  4.86k|    }
  171|  5.73k|    const int dst_offset = p * num_components;
  172|  5.73k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 1.35k, False: 4.37k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  1.35k|      const int src_offset = (p - 1) * num_components;
  176|  1.35k|      this->transform().ComputeOriginalValue(
  177|  1.35k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  4.37k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   515k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 511k, False: 4.37k]
  ------------------
  181|   511k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   511k|      }
  183|  4.37k|      this->transform().ComputeOriginalValue(
  184|  4.37k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  4.37k|    }
  186|  5.73k|  }
  187|      9|  return true;
  188|     24|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|    213|           const std::vector<int32_t> *vertex_to_data_map) {
   38|    213|    mesh_ = mesh;
   39|    213|    corner_table_ = table;
   40|    213|    data_to_corner_map_ = data_to_corner_map;
   41|    213|    vertex_to_data_map_ = vertex_to_data_map;
   42|    213|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|   198k|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|   160k|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|   160k|    return vertex_to_data_map_;
   48|   160k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  44.3k|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  44.3k|    return data_to_corner_map_;
   51|  44.3k|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|    285|           const std::vector<int32_t> *vertex_to_data_map) {
   38|    285|    mesh_ = mesh;
   39|    285|    corner_table_ = table;
   40|    285|    data_to_corner_map_ = data_to_corner_map;
   41|    285|    vertex_to_data_map_ = vertex_to_data_map;
   42|    285|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  4.03M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  3.74M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  3.74M|    return vertex_to_data_map_;
   48|  3.74M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|   599k|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|   599k|    return data_to_corner_map_;
   51|   599k|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|    213|      : mesh_(nullptr),
   31|    213|        corner_table_(nullptr),
   32|    213|        vertex_to_data_map_(nullptr),
   33|    213|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|    285|      : mesh_(nullptr),
   31|    285|        corner_table_(nullptr),
   32|    285|        vertex_to_data_map_(nullptr),
   33|    285|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  21.7k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   123k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   151k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    192|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    192|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  24.6k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    242|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    242|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   325k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|      9|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|      9|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     18|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     18|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     12|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     12|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     24|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     24|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|     18|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|      9|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|      9|    DRACO_DCHECK_EQ(i, 0);
   70|      9|    (void)i;
   71|      9|    return GeometryAttribute::POSITION;
   72|      9|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|      9|  bool SetParentAttribute(const PointAttribute *att) override {
   75|      9|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 9]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|      9|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 9]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|      9|    predictor_.SetPositionAttribute(*att);
   82|      9|    return true;
   83|      9|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|      9|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|      9|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 0, False: 9]
  ------------------
  145|      0|    return false;
  146|      0|  }
  147|       |
  148|      9|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|      9|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|      9|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 4, False: 5]
  ------------------
  150|      4|    uint8_t prediction_mode;
  151|      4|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 4]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|      4|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 0, False: 4]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      0|      return false;
  157|      0|    }
  158|       |
  159|      4|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 4]
  ------------------
  160|      4|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|      4|  }
  164|      9|#endif
  165|       |
  166|       |  // Init normal flips.
  167|      9|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 5]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|      5|  return true;
  172|      9|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|      5|                                      const PointIndex *entry_to_point_id_map) {
  103|      5|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|      5|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|      5|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|      5|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|      5|  const int corner_map_size =
  111|      5|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|      5|  VectorD<int32_t, 3> pred_normal_3d;
  114|      5|  int32_t pred_normal_oct[2];
  115|       |
  116|  21.7k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 21.7k, False: 5]
  ------------------
  117|  21.7k|    const CornerIndex corner_id =
  118|  21.7k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  21.7k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  21.7k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  21.7k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  21.7k|                    octahedron_tool_box_.center_value());
  125|  21.7k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 21.5k, False: 184]
  ------------------
  126|  21.5k|      pred_normal_3d = -pred_normal_3d;
  127|  21.5k|    }
  128|  21.7k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  21.7k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  21.7k|    const int data_offset = data_id * 2;
  132|  21.7k|    this->transform().ComputeOriginalValue(
  133|  21.7k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  21.7k|  }
  135|      5|  flip_normal_bit_decoder_.EndDecoding();
  136|      5|  return true;
  137|      5|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|      5|  void SetQuantizationBits(int q) {
   85|      5|    octahedron_tool_box_.SetQuantizationBits(q);
   86|      5|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|     36|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|     18|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|     18|    DRACO_DCHECK_EQ(i, 0);
   70|     18|    (void)i;
   71|     18|    return GeometryAttribute::POSITION;
   72|     18|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|     18|  bool SetParentAttribute(const PointAttribute *att) override {
   75|     18|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 18]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|     18|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 18]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|     18|    predictor_.SetPositionAttribute(*att);
   82|     18|    return true;
   83|     18|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|     18|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|     18|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 0, False: 18]
  ------------------
  145|      0|    return false;
  146|      0|  }
  147|       |
  148|     18|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|     18|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     18|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 0, False: 18]
  ------------------
  150|      0|    uint8_t prediction_mode;
  151|      0|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 0]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|      0|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 0, False: 0]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      0|      return false;
  157|      0|    }
  158|       |
  159|      0|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 0]
  ------------------
  160|      0|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|      0|  }
  164|     18|#endif
  165|       |
  166|       |  // Init normal flips.
  167|     18|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 0, False: 18]
  ------------------
  168|      0|    return false;
  169|      0|  }
  170|       |
  171|     18|  return true;
  172|     18|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     18|                                      const PointIndex *entry_to_point_id_map) {
  103|     18|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     18|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     18|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     18|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     18|  const int corner_map_size =
  111|     18|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     18|  VectorD<int32_t, 3> pred_normal_3d;
  114|     18|  int32_t pred_normal_oct[2];
  115|       |
  116|   123k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 123k, False: 18]
  ------------------
  117|   123k|    const CornerIndex corner_id =
  118|   123k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   123k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   123k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   123k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   123k|                    octahedron_tool_box_.center_value());
  125|   123k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 109k, False: 13.7k]
  ------------------
  126|   109k|      pred_normal_3d = -pred_normal_3d;
  127|   109k|    }
  128|   123k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   123k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   123k|    const int data_offset = data_id * 2;
  132|   123k|    this->transform().ComputeOriginalValue(
  133|   123k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   123k|  }
  135|     18|  flip_normal_bit_decoder_.EndDecoding();
  136|     18|  return true;
  137|     18|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     18|  void SetQuantizationBits(int q) {
   85|     18|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     18|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|     24|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|     12|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|     12|    DRACO_DCHECK_EQ(i, 0);
   70|     12|    (void)i;
   71|     12|    return GeometryAttribute::POSITION;
   72|     12|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|     12|  bool SetParentAttribute(const PointAttribute *att) override {
   75|     12|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 12]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|     12|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 12]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|     12|    predictor_.SetPositionAttribute(*att);
   82|     12|    return true;
   83|     12|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|     12|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|     12|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 0, False: 12]
  ------------------
  145|      0|    return false;
  146|      0|  }
  147|       |
  148|     12|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|     12|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     12|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 12, False: 0]
  ------------------
  150|     12|    uint8_t prediction_mode;
  151|     12|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 12]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     12|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 11, False: 1]
  ------------------
  155|       |      // Invalid prediction mode.
  156|     11|      return false;
  157|     11|    }
  158|       |
  159|      1|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 1]
  ------------------
  160|      1|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|      1|  }
  164|      1|#endif
  165|       |
  166|       |  // Init normal flips.
  167|      1|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 1, False: 0]
  ------------------
  168|      1|    return false;
  169|      1|  }
  170|       |
  171|      0|  return true;
  172|      1|}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|     48|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|     24|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|     24|    DRACO_DCHECK_EQ(i, 0);
   70|     24|    (void)i;
   71|     24|    return GeometryAttribute::POSITION;
   72|     24|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|     24|  bool SetParentAttribute(const PointAttribute *att) override {
   75|     24|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 24]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|     24|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 24]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|     24|    predictor_.SetPositionAttribute(*att);
   82|     24|    return true;
   83|     24|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|     24|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|     24|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 1, False: 23]
  ------------------
  145|      1|    return false;
  146|      1|  }
  147|       |
  148|     23|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|     23|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     23|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 0, False: 23]
  ------------------
  150|      0|    uint8_t prediction_mode;
  151|      0|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 0]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|      0|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 0, False: 0]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      0|      return false;
  157|      0|    }
  158|       |
  159|      0|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 0]
  ------------------
  160|      0|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|      0|  }
  164|     23|#endif
  165|       |
  166|       |  // Init normal flips.
  167|     23|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 0, False: 23]
  ------------------
  168|      0|    return false;
  169|      0|  }
  170|       |
  171|     23|  return true;
  172|     23|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     23|                                      const PointIndex *entry_to_point_id_map) {
  103|     23|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     23|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     23|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     23|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     23|  const int corner_map_size =
  111|     23|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     23|  VectorD<int32_t, 3> pred_normal_3d;
  114|     23|  int32_t pred_normal_oct[2];
  115|       |
  116|   151k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 151k, False: 23]
  ------------------
  117|   151k|    const CornerIndex corner_id =
  118|   151k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   151k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   151k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   151k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   151k|                    octahedron_tool_box_.center_value());
  125|   151k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 150k, False: 68]
  ------------------
  126|   150k|      pred_normal_3d = -pred_normal_3d;
  127|   150k|    }
  128|   151k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   151k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   151k|    const int data_offset = data_id * 2;
  132|   151k|    this->transform().ComputeOriginalValue(
  133|   151k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   151k|  }
  135|     23|  flip_normal_bit_decoder_.EndDecoding();
  136|     23|  return true;
  137|     23|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     23|  void SetQuantizationBits(int q) {
   85|     23|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     23|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     72|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|     72|            attribute, transform, mesh_data),
   37|     72|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    144|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|     72|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|     72|    DRACO_DCHECK_EQ(i, 0);
   70|     72|    (void)i;
   71|     72|    return GeometryAttribute::POSITION;
   72|     72|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|     72|  bool SetParentAttribute(const PointAttribute *att) override {
   75|     72|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 72]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|     72|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 72]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|     72|    predictor_.SetPositionAttribute(*att);
   82|     72|    return true;
   83|     72|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|     71|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|     71|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 1, False: 70]
  ------------------
  145|      1|    return false;
  146|      1|  }
  147|       |
  148|     70|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|     70|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     70|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 11, False: 59]
  ------------------
  150|     11|    uint8_t prediction_mode;
  151|     11|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 11]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     11|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 0, False: 11]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      0|      return false;
  157|      0|    }
  158|       |
  159|     11|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 11]
  ------------------
  160|     11|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     11|  }
  164|     70|#endif
  165|       |
  166|       |  // Init normal flips.
  167|     70|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 1, False: 69]
  ------------------
  168|      1|    return false;
  169|      1|  }
  170|       |
  171|     69|  return true;
  172|     70|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     69|                                      const PointIndex *entry_to_point_id_map) {
  103|     69|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     69|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     69|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     69|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     69|  const int corner_map_size =
  111|     69|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     69|  VectorD<int32_t, 3> pred_normal_3d;
  114|     69|  int32_t pred_normal_oct[2];
  115|       |
  116|  13.3k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 13.3k, False: 69]
  ------------------
  117|  13.3k|    const CornerIndex corner_id =
  118|  13.3k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  13.3k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  13.3k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  13.3k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  13.3k|                    octahedron_tool_box_.center_value());
  125|  13.3k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 12.3k, False: 939]
  ------------------
  126|  12.3k|      pred_normal_3d = -pred_normal_3d;
  127|  12.3k|    }
  128|  13.3k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  13.3k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  13.3k|    const int data_offset = data_id * 2;
  132|  13.3k|    this->transform().ComputeOriginalValue(
  133|  13.3k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  13.3k|  }
  135|     69|  flip_normal_bit_decoder_.EndDecoding();
  136|     69|  return true;
  137|     69|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|     69|  void SetQuantizationBits(int q) {
   85|     69|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     69|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    126|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    126|            attribute, transform, mesh_data),
   37|    126|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    252|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    126|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    126|    DRACO_DCHECK_EQ(i, 0);
   70|    126|    (void)i;
   71|    126|    return GeometryAttribute::POSITION;
   72|    126|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    126|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    126|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 126]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    126|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 126]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|    126|    predictor_.SetPositionAttribute(*att);
   82|    126|    return true;
   83|    126|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    126|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    126|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 2, False: 124]
  ------------------
  145|      2|    return false;
  146|      2|  }
  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: 0, False: 124]
  ------------------
  150|      0|    uint8_t prediction_mode;
  151|      0|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 0]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|      0|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 0, False: 0]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      0|      return false;
  157|      0|    }
  158|       |
  159|      0|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 0]
  ------------------
  160|      0|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|      0|  }
  164|    124|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    124|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 8, False: 116]
  ------------------
  168|      8|    return false;
  169|      8|  }
  170|       |
  171|    116|  return true;
  172|    124|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_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|  16.3k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 16.1k, False: 116]
  ------------------
  117|  16.1k|    const CornerIndex corner_id =
  118|  16.1k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|  16.1k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|  16.1k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|  16.1k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|  16.1k|                    octahedron_tool_box_.center_value());
  125|  16.1k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 15.3k, False: 864]
  ------------------
  126|  15.3k|      pred_normal_3d = -pred_normal_3d;
  127|  15.3k|    }
  128|  16.1k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|  16.1k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|  16.1k|    const int data_offset = data_id * 2;
  132|  16.1k|    this->transform().ComputeOriginalValue(
  133|  16.1k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|  16.1k|  }
  135|    116|  flip_normal_bit_decoder_.EndDecoding();
  136|    116|  return true;
  137|    116|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    116|  void SetQuantizationBits(int q) {
   85|    116|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    116|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|      9|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|      9|            attribute, transform, mesh_data),
   37|      9|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     18|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|     18|            attribute, transform, mesh_data),
   37|     18|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     12|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|     12|            attribute, transform, mesh_data),
   37|     12|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     24|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|     24|            attribute, transform, mesh_data),
   37|     24|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     13|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     13|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 4, False: 9]
  ------------------
  105|      4|      this->normal_prediction_mode_ = mode;
  106|      4|      return true;
  107|      9|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 9, False: 0]
  ------------------
  108|      9|      this->normal_prediction_mode_ = mode;
  109|      9|      return true;
  110|      9|    }
  111|      0|    return false;
  112|     13|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  21.7k|                             DataTypeT *prediction) override {
   42|  21.7k|    DRACO_DCHECK(this->IsInitialized());
   43|  21.7k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  21.7k|    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|  21.7k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  21.7k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  21.7k|    VectorD<int64_t, 3> normal;
   53|  21.7k|    CornerIndex c_next, c_prev;
   54|  63.7k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 42.0k, False: 21.7k]
  ------------------
   55|       |      // Getting corners.
   56|  42.0k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 42.0k]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|  42.0k|      } else {
   60|  42.0k|        c_next = corner_table->Next(cit.Corner());
   61|  42.0k|        c_prev = corner_table->Previous(cit.Corner());
   62|  42.0k|      }
   63|  42.0k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  42.0k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  42.0k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  42.0k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  42.0k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  42.0k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  42.0k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  42.0k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  42.0k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  42.0k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  42.0k|      cit.Next();
   81|  42.0k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  21.7k|    constexpr int64_t upper_bound = 1 << 29;
   85|  21.7k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 21.7k]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|  21.7k|    } else {
   92|  21.7k|      const int64_t abs_sum = normal.AbsSum();
   93|  21.7k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 147, False: 21.5k]
  ------------------
   94|    147|        const int64_t quotient = abs_sum / upper_bound;
   95|    147|        normal = normal / quotient;
   96|    147|      }
   97|  21.7k|    }
   98|  21.7k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  21.7k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  21.7k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  21.7k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  21.7k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     18|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     18|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 18]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|     18|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 18, False: 0]
  ------------------
  108|     18|      this->normal_prediction_mode_ = mode;
  109|     18|      return true;
  110|     18|    }
  111|      0|    return false;
  112|     18|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   123k|                             DataTypeT *prediction) override {
   42|   123k|    DRACO_DCHECK(this->IsInitialized());
   43|   123k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   123k|    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|   123k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   123k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   123k|    VectorD<int64_t, 3> normal;
   53|   123k|    CornerIndex c_next, c_prev;
   54|   864k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 740k, False: 123k]
  ------------------
   55|       |      // Getting corners.
   56|   740k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 740k]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|   740k|      } else {
   60|   740k|        c_next = corner_table->Next(cit.Corner());
   61|   740k|        c_prev = corner_table->Previous(cit.Corner());
   62|   740k|      }
   63|   740k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   740k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   740k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   740k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   740k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   740k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   740k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   740k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   740k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   740k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   740k|      cit.Next();
   81|   740k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   123k|    constexpr int64_t upper_bound = 1 << 29;
   85|   123k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 123k]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|   123k|    } else {
   92|   123k|      const int64_t abs_sum = normal.AbsSum();
   93|   123k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 110k, False: 13.4k]
  ------------------
   94|   110k|        const int64_t quotient = abs_sum / upper_bound;
   95|   110k|        normal = normal / quotient;
   96|   110k|      }
   97|   123k|    }
   98|   123k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   123k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   123k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   123k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   123k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     13|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     13|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 1, False: 12]
  ------------------
  105|      1|      this->normal_prediction_mode_ = mode;
  106|      1|      return true;
  107|     12|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 12, False: 0]
  ------------------
  108|     12|      this->normal_prediction_mode_ = mode;
  109|     12|      return true;
  110|     12|    }
  111|      0|    return false;
  112|     13|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     24|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     24|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 24]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|     24|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 24, False: 0]
  ------------------
  108|     24|      this->normal_prediction_mode_ = mode;
  109|     24|      return true;
  110|     24|    }
  111|      0|    return false;
  112|     24|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   151k|                             DataTypeT *prediction) override {
   42|   151k|    DRACO_DCHECK(this->IsInitialized());
   43|   151k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   151k|    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|   151k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   151k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   151k|    VectorD<int64_t, 3> normal;
   53|   151k|    CornerIndex c_next, c_prev;
   54|  1.05M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 905k, False: 151k]
  ------------------
   55|       |      // Getting corners.
   56|   905k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 905k]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|   905k|      } else {
   60|   905k|        c_next = corner_table->Next(cit.Corner());
   61|   905k|        c_prev = corner_table->Previous(cit.Corner());
   62|   905k|      }
   63|   905k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   905k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   905k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   905k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   905k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   905k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   905k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   905k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   905k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   905k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   905k|      cit.Next();
   81|   905k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   151k|    constexpr int64_t upper_bound = 1 << 29;
   85|   151k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 151k]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|   151k|    } else {
   92|   151k|      const int64_t abs_sum = normal.AbsSum();
   93|   151k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 136k, False: 14.8k]
  ------------------
   94|   136k|        const int64_t quotient = abs_sum / upper_bound;
   95|   136k|        normal = normal / quotient;
   96|   136k|      }
   97|   151k|    }
   98|   151k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   151k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   151k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   151k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   151k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|     72|      : Base(md) {
   35|     72|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     72|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     83|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     83|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 10, False: 73]
  ------------------
  105|     10|      this->normal_prediction_mode_ = mode;
  106|     10|      return true;
  107|     73|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 73, False: 0]
  ------------------
  108|     73|      this->normal_prediction_mode_ = mode;
  109|     73|      return true;
  110|     73|    }
  111|      0|    return false;
  112|     83|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  13.3k|                             DataTypeT *prediction) override {
   42|  13.3k|    DRACO_DCHECK(this->IsInitialized());
   43|  13.3k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  13.3k|    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|  13.3k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  13.3k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  13.3k|    VectorD<int64_t, 3> normal;
   53|  13.3k|    CornerIndex c_next, c_prev;
   54|  32.2k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 18.9k, False: 13.3k]
  ------------------
   55|       |      // Getting corners.
   56|  18.9k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 60, False: 18.9k]
  ------------------
   57|     60|        c_next = corner_table->Next(corner_id);
   58|     60|        c_prev = corner_table->Previous(corner_id);
   59|  18.9k|      } else {
   60|  18.9k|        c_next = corner_table->Next(cit.Corner());
   61|  18.9k|        c_prev = corner_table->Previous(cit.Corner());
   62|  18.9k|      }
   63|  18.9k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  18.9k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  18.9k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  18.9k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  18.9k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  18.9k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  18.9k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  18.9k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  18.9k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  18.9k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  18.9k|      cit.Next();
   81|  18.9k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  13.3k|    constexpr int64_t upper_bound = 1 << 29;
   85|  13.3k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 44, False: 13.2k]
  ------------------
   86|     44|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     44|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 16, False: 28]
  ------------------
   88|     16|        const int64_t quotient = abs_sum / upper_bound;
   89|     16|        normal = normal / quotient;
   90|     16|      }
   91|  13.2k|    } else {
   92|  13.2k|      const int64_t abs_sum = normal.AbsSum();
   93|  13.2k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.67k, False: 10.5k]
  ------------------
   94|  2.67k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.67k|        normal = normal / quotient;
   96|  2.67k|      }
   97|  13.2k|    }
   98|  13.3k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  13.3k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  13.3k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  13.3k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  13.3k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    126|      : Base(md) {
   35|    126|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    126|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    126|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    126|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 126]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|    126|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 126, False: 0]
  ------------------
  108|    126|      this->normal_prediction_mode_ = mode;
  109|    126|      return true;
  110|    126|    }
  111|      0|    return false;
  112|    126|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  16.1k|                             DataTypeT *prediction) override {
   42|  16.1k|    DRACO_DCHECK(this->IsInitialized());
   43|  16.1k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  16.1k|    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|  16.1k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  16.1k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  16.1k|    VectorD<int64_t, 3> normal;
   53|  16.1k|    CornerIndex c_next, c_prev;
   54|  94.2k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 78.0k, False: 16.1k]
  ------------------
   55|       |      // Getting corners.
   56|  78.0k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 78.0k]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|  78.0k|      } else {
   60|  78.0k|        c_next = corner_table->Next(cit.Corner());
   61|  78.0k|        c_prev = corner_table->Previous(cit.Corner());
   62|  78.0k|      }
   63|  78.0k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  78.0k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  78.0k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  78.0k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  78.0k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  78.0k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  78.0k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  78.0k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  78.0k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  78.0k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  78.0k|      cit.Next();
   81|  78.0k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  16.1k|    constexpr int64_t upper_bound = 1 << 29;
   85|  16.1k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 16.1k]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|  16.1k|    } else {
   92|  16.1k|      const int64_t abs_sum = normal.AbsSum();
   93|  16.1k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.69k, False: 14.4k]
  ------------------
   94|  1.69k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.69k|        normal = normal / quotient;
   96|  1.69k|      }
   97|  16.1k|    }
   98|  16.1k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  16.1k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  16.1k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  16.1k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  16.1k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|      9|      : Base(md) {
   35|      9|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|      9|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     18|      : Base(md) {
   35|     18|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     18|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|     12|      : Base(md) {
   35|     12|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     12|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     24|      : Base(md) {
   35|     24|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     24|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   105k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   105k|    DRACO_DCHECK(this->IsInitialized());
   73|   105k|    const auto corner_table = mesh_data_.corner_table();
   74|   105k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   105k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   105k|    return GetPositionForDataId(data_id);
   77|   105k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   105k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   105k|    DRACO_DCHECK(this->IsInitialized());
   65|   105k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   105k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   105k|    VectorD<int64_t, 3> pos;
   68|   105k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   105k|    return pos;
   70|   105k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      9|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      9|    pos_attribute_ = &position_attribute;
   43|      9|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|      5|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|      5|    entry_to_point_id_map_ = map;
   46|      5|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.60M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.60M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.60M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.60M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.60M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.60M|    return GetPositionForDataId(data_id);
   77|  1.60M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.60M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.60M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.60M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.60M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.60M|    VectorD<int64_t, 3> pos;
   68|  1.60M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.60M|    return pos;
   70|  1.60M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     18|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     18|    pos_attribute_ = &position_attribute;
   43|     18|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     18|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     18|    entry_to_point_id_map_ = map;
   46|     18|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     12|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     12|    pos_attribute_ = &position_attribute;
   43|     12|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.96M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.96M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.96M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.96M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.96M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.96M|    return GetPositionForDataId(data_id);
   77|  1.96M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.96M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.96M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.96M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.96M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.96M|    VectorD<int64_t, 3> pos;
   68|  1.96M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.96M|    return pos;
   70|  1.96M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     24|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     24|    pos_attribute_ = &position_attribute;
   43|     24|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     23|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     23|    entry_to_point_id_map_ = map;
   46|     23|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|     72|      : pos_attribute_(nullptr),
   36|     72|        entry_to_point_id_map_(nullptr),
   37|     72|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|     72|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  51.2k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  51.2k|    DRACO_DCHECK(this->IsInitialized());
   73|  51.2k|    const auto corner_table = mesh_data_.corner_table();
   74|  51.2k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  51.2k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  51.2k|    return GetPositionForDataId(data_id);
   77|  51.2k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  51.2k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  51.2k|    DRACO_DCHECK(this->IsInitialized());
   65|  51.2k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  51.2k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  51.2k|    VectorD<int64_t, 3> pos;
   68|  51.2k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  51.2k|    return pos;
   70|  51.2k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     72|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     72|    pos_attribute_ = &position_attribute;
   43|     72|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     69|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     69|    entry_to_point_id_map_ = map;
   46|     69|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    126|      : pos_attribute_(nullptr),
   36|    126|        entry_to_point_id_map_(nullptr),
   37|    126|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    126|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   172k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   172k|    DRACO_DCHECK(this->IsInitialized());
   73|   172k|    const auto corner_table = mesh_data_.corner_table();
   74|   172k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   172k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   172k|    return GetPositionForDataId(data_id);
   77|   172k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|   172k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   172k|    DRACO_DCHECK(this->IsInitialized());
   65|   172k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   172k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   172k|    VectorD<int64_t, 3> pos;
   68|   172k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   172k|    return pos;
   70|   172k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    126|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    126|    pos_attribute_ = &position_attribute;
   43|    126|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_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_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|      9|      : pos_attribute_(nullptr),
   36|      9|        entry_to_point_id_map_(nullptr),
   37|      9|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|      9|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|     18|      : pos_attribute_(nullptr),
   36|     18|        entry_to_point_id_map_(nullptr),
   37|     18|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     18|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|     12|      : pos_attribute_(nullptr),
   36|     12|        entry_to_point_id_map_(nullptr),
   37|     12|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|     12|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|     24|      : pos_attribute_(nullptr),
   36|     24|        entry_to_point_id_map_(nullptr),
   37|     24|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     24|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|      6|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|      6|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|      3|                          const PointIndex * /* entry_to_point_id_map */) {
   64|      3|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|      3|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|      3|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|      3|      new DataTypeT[num_components]());
   70|       |
   71|      3|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|      3|  const CornerTable *const table = this->mesh_data().corner_table();
   74|      3|  const std::vector<int32_t> *const vertex_to_data_map =
   75|      3|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|      3|  const int corner_map_size =
   78|      3|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    130|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 127, False: 3]
  ------------------
   80|    127|    const CornerIndex start_corner_id =
   81|    127|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|    127|    CornerIndex corner_id(start_corner_id);
   84|    127|    int num_parallelograms = 0;
   85|  2.25k|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 2.13k, False: 127]
  ------------------
   86|  2.13k|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  2.13k|    }
   88|    373|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 246, False: 127]
  ------------------
   89|    246|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 89, False: 157]
  ------------------
   90|    246|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|    246|              num_components, parallelogram_pred_vals.get())) {
   92|  2.10k|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 2.01k, False: 89]
  ------------------
   93|  2.01k|          pred_vals[c] =
   94|  2.01k|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  2.01k|        }
   96|     89|        ++num_parallelograms;
   97|     89|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|    246|      corner_id = table->SwingRight(corner_id);
  101|    246|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 10, False: 236]
  ------------------
  102|     10|        corner_id = kInvalidCornerIndex;
  103|     10|      }
  104|    246|    }
  105|       |
  106|    127|    const int dst_offset = p * num_components;
  107|    127|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 49, False: 78]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|     49|      const int src_offset = (p - 1) * num_components;
  111|     49|      this->transform().ComputeOriginalValue(
  112|     49|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|     78|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  1.56k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 1.48k, False: 78]
  ------------------
  116|  1.48k|        pred_vals[c] /= num_parallelograms;
  117|  1.48k|      }
  118|     78|      this->transform().ComputeOriginalValue(
  119|     78|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|     78|    }
  121|    127|  }
  122|      3|  return true;
  123|      3|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|     58|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|     58|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|     49|                          const PointIndex * /* entry_to_point_id_map */) {
   64|     49|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|     49|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|     49|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|     49|      new DataTypeT[num_components]());
   70|       |
   71|     49|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|     49|  const CornerTable *const table = this->mesh_data().corner_table();
   74|     49|  const std::vector<int32_t> *const vertex_to_data_map =
   75|     49|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|     49|  const int corner_map_size =
   78|     49|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   295k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 295k, False: 49]
  ------------------
   80|   295k|    const CornerIndex start_corner_id =
   81|   295k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   295k|    CornerIndex corner_id(start_corner_id);
   84|   295k|    int num_parallelograms = 0;
   85|  1.18M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 887k, False: 295k]
  ------------------
   86|   887k|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|   887k|    }
   88|  2.06M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.76M, False: 295k]
  ------------------
   89|  1.76M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 569k, False: 1.20M]
  ------------------
   90|  1.76M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.76M|              num_components, parallelogram_pred_vals.get())) {
   92|  2.28M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 1.71M, False: 569k]
  ------------------
   93|  1.71M|          pred_vals[c] =
   94|  1.71M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  1.71M|        }
   96|   569k|        ++num_parallelograms;
   97|   569k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.76M|      corner_id = table->SwingRight(corner_id);
  101|  1.76M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 295k, False: 1.47M]
  ------------------
  102|   295k|        corner_id = kInvalidCornerIndex;
  103|   295k|      }
  104|  1.76M|    }
  105|       |
  106|   295k|    const int dst_offset = p * num_components;
  107|   295k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 227, False: 294k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|    227|      const int src_offset = (p - 1) * num_components;
  111|    227|      this->transform().ComputeOriginalValue(
  112|    227|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   294k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  1.18M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 886k, False: 294k]
  ------------------
  116|   886k|        pred_vals[c] /= num_parallelograms;
  117|   886k|      }
  118|   294k|      this->transform().ComputeOriginalValue(
  119|   294k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   294k|    }
  121|   295k|  }
  122|     49|  return true;
  123|     49|}

_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|     42|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|     42|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|     40|                          const PointIndex * /* entry_to_point_id_map */) {
   61|     40|  this->transform().Init(num_components);
   62|       |
   63|     40|  const CornerTable *const table = this->mesh_data().corner_table();
   64|     40|  const std::vector<int32_t> *const vertex_to_data_map =
   65|     40|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|     40|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|     40|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|     40|  const int corner_map_size =
   74|     40|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|  4.43k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (75:19): [True: 4.39k, False: 40]
  ------------------
   76|  4.39k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   77|  4.39k|    const int dst_offset = p * num_components;
   78|  4.39k|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (78:9): [True: 4.00k, False: 392]
  ------------------
   79|  4.39k|                                        *vertex_to_data_map, out_data,
   80|  4.39k|                                        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|  4.00k|      const int src_offset = (p - 1) * num_components;
   85|  4.00k|      this->transform().ComputeOriginalValue(
   86|  4.00k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   87|  4.00k|    } else {
   88|       |      // Apply the parallelogram prediction.
   89|    392|      this->transform().ComputeOriginalValue(
   90|    392|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   91|    392|    }
   92|  4.39k|  }
   93|     40|  return true;
   94|     40|}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|     20|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|     20|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|     17|                          const PointIndex * /* entry_to_point_id_map */) {
   61|     17|  this->transform().Init(num_components);
   62|       |
   63|     17|  const CornerTable *const table = this->mesh_data().corner_table();
   64|     17|  const std::vector<int32_t> *const vertex_to_data_map =
   65|     17|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|     17|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|     17|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|     17|  const int corner_map_size =
   74|     17|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|  7.78k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (75:19): [True: 7.76k, False: 17]
  ------------------
   76|  7.76k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   77|  7.76k|    const int dst_offset = p * num_components;
   78|  7.76k|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (78:9): [True: 58, False: 7.71k]
  ------------------
   79|  7.76k|                                        *vertex_to_data_map, out_data,
   80|  7.76k|                                        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|     58|      const int src_offset = (p - 1) * num_components;
   85|     58|      this->transform().ComputeOriginalValue(
   86|     58|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   87|  7.71k|    } else {
   88|       |      // Apply the parallelogram prediction.
   89|  7.71k|      this->transform().ComputeOriginalValue(
   90|  7.71k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   91|  7.71k|    }
   92|  7.76k|  }
   93|     17|  return true;
   94|     17|}

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  8.96k|    int num_components, DataTypeT *out_prediction) {
   49|  8.96k|  const CornerIndex oci = table->Opposite(ci);
   50|  8.96k|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 6.99k, False: 1.97k]
  ------------------
   51|  6.99k|    return false;
   52|  6.99k|  }
   53|  1.97k|  int vert_opp, vert_next, vert_prev;
   54|  1.97k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.97k|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.97k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 990, False: 980]
  |  Branch (56:35): [True: 911, False: 79]
  ------------------
   57|    911|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 904, False: 7]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|    904|    const int v_opp_off = vert_opp * num_components;
   60|    904|    const int v_next_off = vert_next * num_components;
   61|    904|    const int v_prev_off = vert_prev * num_components;
   62|  7.98k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 7.08k, False: 904]
  ------------------
   63|  7.08k|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  7.08k|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  7.08k|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  7.08k|      const int64_t result =
   67|  7.08k|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  7.08k|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  7.08k|    }
   71|    904|    return true;
   72|    904|  }
   73|  1.06k|  return false;  // Not all data is available for prediction
   74|  1.97k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.97k|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  1.97k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.97k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.97k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.97k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  1.80M|    int num_components, DataTypeT *out_prediction) {
   49|  1.80M|  const CornerIndex oci = table->Opposite(ci);
   50|  1.80M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 989, False: 1.80M]
  ------------------
   51|    989|    return false;
   52|    989|  }
   53|  1.80M|  int vert_opp, vert_next, vert_prev;
   54|  1.80M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.80M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.80M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 905k, False: 901k]
  |  Branch (56:35): [True: 641k, False: 264k]
  ------------------
   57|   641k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 586k, False: 54.4k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   586k|    const int v_opp_off = vert_opp * num_components;
   60|   586k|    const int v_next_off = vert_next * num_components;
   61|   586k|    const int v_prev_off = vert_prev * num_components;
   62|  3.55M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 2.97M, False: 586k]
  ------------------
   63|  2.97M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  2.97M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  2.97M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  2.97M|      const int64_t result =
   67|  2.97M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  2.97M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  2.97M|    }
   71|   586k|    return true;
   72|   586k|  }
   73|  1.22M|  return false;  // Not all data is available for prediction
   74|  1.80M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.80M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  1.80M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.80M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.80M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.80M|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|     18|      : pos_attribute_(nullptr),
   39|     18|        entry_to_point_id_map_(nullptr),
   40|     18|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     18|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     18|    pos_attribute_ = &position_attribute;
   43|     18|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|     17|  void ResizeOrientations(int num_orientations) {
   74|     17|    orientations_.resize(num_orientations);
   75|     17|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|   320M|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     17|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     17|    entry_to_point_id_map_ = map;
   46|     17|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|  1.32k|                                                 int data_id) {
   94|       |  // Compute the predicted UV coordinate from the positions on all corners
   95|       |  // of the processed triangle. For the best prediction, the UV coordinates
   96|       |  // on the next/previous corners need to be already encoded/decoded.
   97|  1.32k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|  1.32k|  const CornerIndex prev_corner_id =
   99|  1.32k|      mesh_data_.corner_table()->Previous(corner_id);
  100|       |  // Get the encoded data ids from the next and previous corners.
  101|       |  // The data id is the encoding order of the UV coordinates.
  102|  1.32k|  int next_data_id, prev_data_id;
  103|       |
  104|  1.32k|  int next_vert_id, prev_vert_id;
  105|  1.32k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|  1.32k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|  1.32k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|  1.32k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|  1.32k|  typedef VectorD<int64_t, 2> Vec2;
  112|  1.32k|  typedef VectorD<int64_t, 3> Vec3;
  113|  1.32k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|  1.32k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 944, False: 378]
  |  Branch (115:33): [True: 565, False: 379]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|    565|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|    565|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|    565|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 54, False: 511]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|     54|      predicted_value_[0] = p_uv[0];
  122|     54|      predicted_value_[1] = p_uv[1];
  123|     54|      return true;
  124|     54|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|    511|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|    511|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|    511|    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|    511|    const Vec3 pn = prev_pos - next_pos;
  146|    511|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|    511|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 480, False: 31]
  ------------------
  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|    480|      const Vec3 cn = tip_pos - next_pos;
  153|    480|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    480|      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|    480|      const int64_t n_uv_absmax_element =
  164|    480|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    480|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 2, False: 478]
  ------------------
  166|    480|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|      2|        return false;
  169|      2|      }
  170|    478|      const int64_t pn_uv_absmax_element =
  171|    478|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    478|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 4, False: 474]
  ------------------
  173|    478|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      4|        return false;
  176|      4|      }
  177|    474|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|    474|      const int64_t pn_absmax_element =
  179|    474|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|    474|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 0, False: 474]
  ------------------
  181|    474|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      0|        return false;
  184|      0|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|    474|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|    474|      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|    474|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|    474|      const uint64_t norm_squared =
  207|    474|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|    474|      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|    474|      Vec2 predicted_uv;
  214|    474|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 474]
  ------------------
  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|    474|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|    474|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 0, False: 474]
  ------------------
  233|      0|          return false;
  234|      0|        }
  235|    474|        const bool orientation = orientations_.back();
  236|    474|        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|    474|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 75, False: 399]
  ------------------
  240|     75|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    399|        } else {
  242|    399|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    399|        }
  244|    474|      }
  245|    474|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|    474|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|    474|      return true;
  248|    474|    }
  249|    511|  }
  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|    788|  int data_offset = 0;
  254|    788|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 410, False: 378]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|    410|    data_offset = prev_data_id * kNumComponents;
  257|    410|  }
  258|    788|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 31, False: 757]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|     31|    data_offset = next_data_id * kNumComponents;
  261|    757|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    757|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 740, False: 17]
  ------------------
  265|    740|      data_offset = (data_id - 1) * kNumComponents;
  266|    740|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|     51|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 34, False: 17]
  ------------------
  269|     34|        predicted_value_[i] = 0;
  270|     34|      }
  271|     17|      return true;
  272|     17|    }
  273|    757|  }
  274|  2.31k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 1.54k, False: 771]
  ------------------
  275|  1.54k|    predicted_value_[i] = data[data_offset + i];
  276|  1.54k|  }
  277|    771|  return true;
  278|    788|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|  1.13k|                                            const DataTypeT *data) const {
   59|  1.13k|    const int data_offset = entry_id * kNumComponents;
   60|  1.13k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|  1.13k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  1.53k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  1.53k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  1.53k|    VectorD<int64_t, 3> pos;
   52|  1.53k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  1.53k|                                 &pos[0]);
   54|  1.53k|    return pos;
   55|  1.53k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|  1.31k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|      2|      : pos_attribute_(nullptr),
   39|      2|        entry_to_point_id_map_(nullptr),
   40|      2|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      2|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      2|    pos_attribute_ = &position_attribute;
   43|      2|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|      2|  void ResizeOrientations(int num_orientations) {
   74|      2|    orientations_.resize(num_orientations);
   75|      2|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  2.49M|  void set_orientation(int i, bool v) { orientations_[i] = v; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     10|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|     37|  bool AreCorrectionsPositive() override {
   71|     37|    return transform_.AreCorrectionsPositive();
   72|     37|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     10|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     10|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 9, False: 1]
  ------------------
   50|      9|      return false;
   51|      9|    }
   52|      1|    return true;
   53|     10|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   145k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     15|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|     50|  bool AreCorrectionsPositive() override {
   71|     50|    return transform_.AreCorrectionsPositive();
   72|     50|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     14|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     14|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 3, False: 11]
  ------------------
   50|      3|      return false;
   51|      3|    }
   52|     11|    return true;
   53|     14|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   151k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    456|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|    230|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|    431|  bool AreCorrectionsPositive() override {
   71|    431|    return transform_.AreCorrectionsPositive();
   72|    431|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    215|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    215|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 26, False: 189]
  ------------------
   50|     26|      return false;
   51|     26|    }
   52|    189|    return true;
   53|    215|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|   370k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|     37|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|     51|      : attribute_(attribute), transform_(transform) {}

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

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|      1|    const PointIndex *) {
   50|      1|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|      1|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|      1|  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|      8|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 7, False: 1]
  ------------------
   57|      7|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|      7|                                           in_corr + i, out_data + i);
   59|      7|  }
   60|      1|  return true;
   61|      1|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     11|    const PointIndex *) {
   50|     11|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     11|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     11|  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|    178|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 167, False: 11]
  ------------------
   57|    167|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|    167|                                           in_corr + i, out_data + i);
   59|    167|  }
   60|     11|  return true;
   61|     11|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     22|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     10|    const PointIndex *) {
   50|     10|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     10|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     10|  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|  21.9k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 21.9k, False: 10]
  ------------------
   57|  21.9k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  21.9k|                                           in_corr + i, out_data + i);
   59|  21.9k|  }
   60|     10|  return true;
   61|     10|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     10|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     15|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|     32|    uint16_t bitstream_version) {
   38|     32|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|     32|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 32, False: 0]
  ------------------
   40|     32|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 0, False: 32]
  ------------------
   41|     32|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1, False: 31]
  ------------------
   42|     31|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 31]
  ------------------
   43|     31|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 31]
  ------------------
   44|     31|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 27, False: 4]
  ------------------
   45|     32|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 4, False: 0]
  ------------------
   46|     32|    const CornerTable *const ct = source->GetCornerTable();
   47|     32|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|     32|        source->GetAttributeEncodingData(att_id);
   49|     32|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 4, False: 28]
  |  Branch (49:26): [True: 0, False: 28]
  ------------------
   50|       |      // No connectivity data found.
   51|      4|      return nullptr;
   52|      4|    }
   53|       |    // Connectivity data exists.
   54|     28|    const MeshAttributeCornerTable *const att_ct =
   55|     28|        source->GetAttributeCornerTable(att_id);
   56|     28|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 9, False: 19]
  ------------------
   57|      9|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|      9|      MeshData md;
   59|      9|      md.Set(source->mesh(), att_ct,
   60|      9|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|      9|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|      9|      MeshPredictionSchemeFactoryT factory;
   63|      9|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|      9|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 9, False: 0]
  ------------------
   65|      9|        return ret;
   66|      9|      }
   67|     19|    } else {
   68|     19|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     19|      MeshData md;
   70|     19|      md.Set(source->mesh(), ct,
   71|     19|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     19|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     19|      MeshPredictionSchemeFactoryT factory;
   74|     19|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     19|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 18, False: 1]
  ------------------
   76|     18|        return ret;
   77|     18|      }
   78|     19|    }
   79|     28|  }
   80|      1|  return nullptr;
   81|     32|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|     51|    uint16_t bitstream_version) {
   38|     51|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|     51|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 51, False: 0]
  ------------------
   40|     51|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 2, False: 49]
  ------------------
   41|     49|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 0, False: 49]
  ------------------
   42|     49|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 49]
  ------------------
   43|     49|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 49]
  ------------------
   44|     49|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 38, False: 11]
  ------------------
   45|     47|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 7, False: 4]
  ------------------
   46|     47|    const CornerTable *const ct = source->GetCornerTable();
   47|     47|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|     47|        source->GetAttributeEncodingData(att_id);
   49|     47|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 11, False: 36]
  |  Branch (49:26): [True: 0, False: 36]
  ------------------
   50|       |      // No connectivity data found.
   51|     11|      return nullptr;
   52|     11|    }
   53|       |    // Connectivity data exists.
   54|     36|    const MeshAttributeCornerTable *const att_ct =
   55|     36|        source->GetAttributeCornerTable(att_id);
   56|     36|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 12, False: 24]
  ------------------
   57|     12|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|     12|      MeshData md;
   59|     12|      md.Set(source->mesh(), att_ct,
   60|     12|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|     12|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|     12|      MeshPredictionSchemeFactoryT factory;
   63|     12|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|     12|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 12, False: 0]
  ------------------
   65|     12|        return ret;
   66|     12|      }
   67|     24|    } else {
   68|     24|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     24|      MeshData md;
   70|     24|      md.Set(source->mesh(), ct,
   71|     24|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     24|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     24|      MeshPredictionSchemeFactoryT factory;
   74|     24|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     24|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 24, False: 0]
  ------------------
   76|     24|        return ret;
   77|     24|      }
   78|     24|    }
   79|     36|  }
   80|      4|  return nullptr;
   81|     51|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    456|    uint16_t bitstream_version) {
   38|    456|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    456|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 456, False: 0]
  ------------------
   40|    456|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 62, False: 394]
  ------------------
   41|    394|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 67, False: 327]
  ------------------
   42|    327|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 82, False: 245]
  ------------------
   43|    245|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 20, False: 225]
  ------------------
   44|    225|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 199, False: 26]
  ------------------
   45|    439|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 9, False: 17]
  ------------------
   46|    439|    const CornerTable *const ct = source->GetCornerTable();
   47|    439|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    439|        source->GetAttributeEncodingData(att_id);
   49|    439|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 5, False: 434]
  |  Branch (49:26): [True: 0, False: 434]
  ------------------
   50|       |      // No connectivity data found.
   51|      5|      return nullptr;
   52|      5|    }
   53|       |    // Connectivity data exists.
   54|    434|    const MeshAttributeCornerTable *const att_ct =
   55|    434|        source->GetAttributeCornerTable(att_id);
   56|    434|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 192, False: 242]
  ------------------
   57|    192|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    192|      MeshData md;
   59|    192|      md.Set(source->mesh(), att_ct,
   60|    192|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    192|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    192|      MeshPredictionSchemeFactoryT factory;
   63|    192|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    192|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 192, False: 0]
  ------------------
   65|    192|        return ret;
   66|    192|      }
   67|    242|    } else {
   68|    242|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    242|      MeshData md;
   70|    242|      md.Set(source->mesh(), ct,
   71|    242|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    242|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    242|      MeshPredictionSchemeFactoryT factory;
   74|    242|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    242|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 242, False: 0]
  ------------------
   76|    242|        return ret;
   77|    242|      }
   78|    242|    }
   79|    434|  }
   80|     17|  return nullptr;
   81|    456|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   151k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   151k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 19.5k, False: 131k]
  |  Branch (93:22): [True: 15.0k, False: 4.55k]
  ------------------
   94|  15.0k|      return true;
   95|  15.0k|    }
   96|   136k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 65.4k, False: 70.7k]
  |  Branch (96:25): [True: 31.4k, False: 33.9k]
  ------------------
   97|   151k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   151k|  int32_t GetRotationCount(Point2 pred) const {
   51|   151k|    const DataType sign_x = pred[0];
   52|   151k|    const DataType sign_y = pred[1];
   53|       |
   54|   151k|    int32_t rotation_count = 0;
   55|   151k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 19.5k, False: 131k]
  ------------------
   56|  19.5k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 15.0k, False: 4.55k]
  ------------------
   57|  15.0k|        rotation_count = 0;
   58|  15.0k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 2.22k, False: 2.33k]
  ------------------
   59|  2.22k|        rotation_count = 3;
   60|  2.33k|      } else {
   61|  2.33k|        rotation_count = 1;
   62|  2.33k|      }
   63|   131k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 66.1k, False: 65.4k]
  ------------------
   64|  66.1k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 31.0k, False: 35.1k]
  ------------------
   65|  31.0k|        rotation_count = 2;
   66|  35.1k|      } else {
   67|  35.1k|        rotation_count = 1;
   68|  35.1k|      }
   69|  66.1k|    } else {
   70|  65.4k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 31.4k, False: 33.9k]
  ------------------
   71|  31.4k|        rotation_count = 0;
   72|  33.9k|      } else {
   73|  33.9k|        rotation_count = 3;
   74|  33.9k|      }
   75|  65.4k|    }
   76|   151k|    return rotation_count;
   77|   151k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   209k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   209k|    switch (rotation_count) {
   81|  73.7k|      case 1:
  ------------------
  |  Branch (81:7): [True: 73.7k, False: 135k]
  ------------------
   82|  73.7k|        return Point2(p[1], -p[0]);
   83|  62.0k|      case 2:
  ------------------
  |  Branch (83:7): [True: 62.0k, False: 147k]
  ------------------
   84|  62.0k|        return Point2(-p[0], -p[1]);
   85|  73.7k|      case 3:
  ------------------
  |  Branch (85:7): [True: 73.7k, False: 135k]
  ------------------
   86|  73.7k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 209k]
  ------------------
   88|      0|        return p;
   89|   209k|    }
   90|   209k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|     51|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

_ZN5draco37PredictionSchemeWrapDecodingTransformIiiE19DecodeTransformDataEPNS_13DecoderBufferE:
   66|    412|  bool DecodeTransformData(DecoderBuffer *buffer) {
   67|    412|    DataTypeT min_value, max_value;
   68|    412|    if (!buffer->Decode(&min_value)) {
  ------------------
  |  Branch (68:9): [True: 0, False: 412]
  ------------------
   69|      0|      return false;
   70|      0|    }
   71|    412|    if (!buffer->Decode(&max_value)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 412]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|    412|    if (min_value > max_value) {
  ------------------
  |  Branch (74:9): [True: 27, False: 385]
  ------------------
   75|     27|      return false;
   76|     27|    }
   77|    385|    this->set_min_value(min_value);
   78|    385|    this->set_max_value(max_value);
   79|    385|    if (!this->InitCorrectionBounds()) {
  ------------------
  |  Branch (79:9): [True: 2, False: 383]
  ------------------
   80|      2|      return false;
   81|      2|    }
   82|    383|    return true;
   83|    385|  }
_ZNK5draco37PredictionSchemeWrapDecodingTransformIiiE20ComputeOriginalValueEPKiS3_Pi:
   38|   369k|                                   DataTypeT *out_original_vals) const {
   39|       |    // For now we assume both |DataTypeT| and |CorrTypeT| are equal.
   40|   369k|    static_assert(std::is_same<DataTypeT, CorrTypeT>::value,
   41|   369k|                  "Predictions and corrections must have the same type.");
   42|       |
   43|       |    // The only valid implementation right now is for int32_t.
   44|   369k|    static_assert(std::is_same<DataTypeT, int32_t>::value,
   45|   369k|                  "Only int32_t is supported for predicted values.");
   46|       |
   47|   369k|    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|   369k|    const uint32_t *const uint_predicted_vals =
   52|   369k|        reinterpret_cast<const uint32_t *>(predicted_vals);
   53|   369k|    const uint32_t *const uint_corr_vals =
   54|   369k|        reinterpret_cast<const uint32_t *>(corr_vals);
   55|  2.12M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (55:21): [True: 1.75M, False: 369k]
  ------------------
   56|  1.75M|      out_original_vals[i] =
   57|  1.75M|          static_cast<DataTypeT>(uint_predicted_vals[i] + uint_corr_vals[i]);
   58|  1.75M|      if (out_original_vals[i] > this->max_value()) {
  ------------------
  |  Branch (58:11): [True: 8.21k, False: 1.74M]
  ------------------
   59|  8.21k|        out_original_vals[i] -= this->max_dif();
   60|  1.74M|      } else if (out_original_vals[i] < this->min_value()) {
  ------------------
  |  Branch (60:18): [True: 279k, False: 1.46M]
  ------------------
   61|   279k|        out_original_vals[i] += this->max_dif();
   62|   279k|      }
   63|  1.75M|    }
   64|   369k|  }
_ZN5draco37PredictionSchemeWrapDecodingTransformIiiEC2Ev:
   32|    456|  PredictionSchemeWrapDecodingTransform() {}

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|    431|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|    385|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|    385|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|    385|  bool InitCorrectionBounds() {
   84|    385|    const int64_t dif =
   85|    385|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|    385|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 385]
  |  Branch (86:20): [True: 2, False: 383]
  ------------------
   87|      2|      return false;
   88|      2|    }
   89|    383|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|    383|    max_correction_ = max_dif_ / 2;
   91|    383|    min_correction_ = -max_correction_;
   92|    383|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 193, False: 190]
  ------------------
   93|    193|      max_correction_ -= 1;
   94|    193|    }
   95|    383|    return true;
   96|    385|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|    189|  void Init(int num_components) {
   56|    189|    num_components_ = num_components;
   57|    189|    clamped_value_.resize(num_components);
   58|    189|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|   369k|      const DataTypeT *predicted_val) const {
   64|  2.12M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 1.75M, False: 369k]
  ------------------
   65|  1.75M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 11.7k, False: 1.74M]
  ------------------
   66|  11.7k|        clamped_value_[i] = max_value_;
   67|  1.74M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 313k, False: 1.43M]
  ------------------
   68|   313k|        clamped_value_[i] = min_value_;
   69|  1.43M|      } else {
   70|  1.43M|        clamped_value_[i] = predicted_val[i];
   71|  1.43M|      }
   72|  1.75M|    }
   73|   369k|    return clamped_value_.data();
   74|   369k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|  4.24M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|  1.75M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|   288k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|  1.74M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    185|  int quantization_bits() const {
   78|    185|    DRACO_DCHECK(false);
   79|    185|    return -1;
   80|    185|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|    456|      : num_components_(0),
   45|    456|        min_value_(0),
   46|    456|        max_value_(0),
   47|    456|        max_dif_(0),
   48|    456|        max_correction_(0),
   49|    456|        min_correction_(0) {}

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|    904|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  23.1k|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|    544|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  2.67k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|    995|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|    995|    portable_attribute_ = std::move(att);
   71|    995|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  3.16k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  3.83k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  2.24k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|    316|    DecoderBuffer *buffer) {
   30|    316|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 29, False: 287]
  ------------------
   31|     29|    return false;
   32|     29|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|    287|  const int32_t num_attributes = GetNumAttributes();
   35|    287|  sequential_decoders_.resize(num_attributes);
   36|  4.12k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 3.83k, False: 285]
  ------------------
   37|  3.83k|    uint8_t decoder_type;
   38|  3.83k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 1, False: 3.83k]
  ------------------
   39|      1|      return false;
   40|      1|    }
   41|       |    // Create the decoder from the id.
   42|  3.83k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  3.83k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 1, False: 3.83k]
  ------------------
   44|      1|      return false;
   45|      1|    }
   46|  3.83k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 0, False: 3.83k]
  ------------------
   47|      0|      return false;
   48|      0|    }
   49|  3.83k|  }
   50|    285|  return true;
   51|    287|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|    282|    DecoderBuffer *buffer) {
   55|    282|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 282]
  |  Branch (55:22): [True: 1, False: 281]
  ------------------
   56|      1|    return false;
   57|      1|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|    281|  const int32_t num_attributes = GetNumAttributes();
   60|  4.10k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 3.82k, False: 281]
  ------------------
   61|  3.82k|    PointAttribute *const pa =
   62|  3.82k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  3.82k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 3.82k]
  ------------------
   64|      0|      return false;
   65|      0|    }
   66|  3.82k|  }
   67|    281|  return AttributesDecoder::DecodeAttributes(buffer);
   68|    281|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|    281|    DecoderBuffer *in_buffer) {
   72|    281|  const int32_t num_attributes = GetNumAttributes();
   73|  1.84k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 1.74k, False: 97]
  ------------------
   74|  1.74k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 184, False: 1.56k]
  ------------------
   75|  1.74k|                                                          in_buffer)) {
   76|    184|      return false;
   77|    184|    }
   78|  1.74k|  }
   79|     97|  return true;
   80|    281|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|     97|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|     97|  const int32_t num_attributes = GetNumAttributes();
   85|    583|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 519, False: 64]
  ------------------
   86|    519|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 33, False: 486]
  ------------------
   87|    519|            point_ids_, in_buffer)) {
   88|     33|      return false;
   89|     33|    }
   90|    519|  }
   91|     64|  return true;
   92|     97|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|     64|    TransformAttributesToOriginalFormat() {
   96|     64|  const int32_t num_attributes = GetNumAttributes();
   97|    497|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 460, False: 37]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|    460|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 460, False: 0]
  ------------------
  100|    460|      const PointAttribute *const attribute =
  101|    460|          sequential_decoders_[i]->attribute();
  102|    460|      const PointAttribute *const portable_attribute =
  103|    460|          sequential_decoders_[i]->GetPortableAttribute();
  104|    460|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 180, False: 280]
  |  Branch (104:11): [True: 47, False: 413]
  ------------------
  105|    180|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 47, False: 133]
  ------------------
  106|    180|              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|     47|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|     47|        continue;
  114|     47|      }
  115|    460|    }
  116|    413|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 27, False: 386]
  ------------------
  117|    413|            point_ids_)) {
  118|     27|      return false;
  119|     27|    }
  120|    413|  }
  121|     37|  return true;
  122|     64|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  3.83k|    uint8_t decoder_type) {
  127|  3.83k|  switch (decoder_type) {
  128|  1.82k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.82k, False: 2.00k]
  ------------------
  129|  1.82k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.82k|          new SequentialAttributeDecoder());
  131|  1.88k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 1.88k, False: 1.95k]
  ------------------
  132|  1.88k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  1.88k|          new SequentialIntegerAttributeDecoder());
  134|     15|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 15, False: 3.81k]
  ------------------
  135|     15|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|     15|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|    108|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 108, False: 3.72k]
  ------------------
  139|    108|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|    108|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|      1|    default:
  ------------------
  |  Branch (142:5): [True: 1, False: 3.83k]
  ------------------
  143|      1|      break;
  144|  3.83k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|      1|  return nullptr;
  147|  3.83k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  2.00k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  2.00k|                                             int attribute_id) {
   27|  2.00k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 2.00k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  2.00k|  return true;
   31|  2.00k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|    133|    const std::vector<PointIndex> &point_ids) {
   35|    133|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|    133|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 133, False: 0]
  ------------------
   37|    133|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    133|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 133]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|    133|#endif
   41|    133|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|    133|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  1.01k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  1.01k|  int8_t prediction_scheme_method;
   48|  1.01k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 0, False: 1.01k]
  ------------------
   49|      0|    return false;
   50|      0|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  1.01k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 2, False: 1.01k]
  ------------------
   53|  1.01k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 6, False: 1.00k]
  ------------------
   54|      8|    return false;
   55|      8|  }
   56|  1.00k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 1.00k, False: 0]
  ------------------
   57|  1.00k|    int8_t prediction_transform_type;
   58|  1.00k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 0, False: 1.00k]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  1.00k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 0, False: 1.00k]
  ------------------
   63|  1.00k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 12, False: 995]
  ------------------
   64|     12|      return false;
   65|     12|    }
   66|    995|    prediction_scheme_ = CreateIntPredictionScheme(
   67|    995|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|    995|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|    995|  }
   70|       |
   71|    995|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 544, False: 451]
  ------------------
   72|    544|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 0, False: 544]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|    544|  }
   76|       |
   77|    995|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 157, False: 838]
  ------------------
   78|    157|    return false;
   79|    157|  }
   80|       |
   81|    838|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|    838|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|    838|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 838, False: 0]
  ------------------
   84|    838|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    838|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 0, False: 838]
  ------------------
   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|    838|#endif
   91|    838|  return true;
   92|    838|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|    904|    PredictionSchemeTransformType transform_type) {
   98|    904|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 448, False: 456]
  ------------------
   99|    448|    return nullptr;  // For now we support only wrap transform.
  100|    448|  }
  101|    456|  return CreatePredictionSchemeForDecoder<
  102|    456|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|    456|      method, attribute_id(), decoder());
  104|    904|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|    995|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|    995|  const int num_components = GetNumValueComponents();
  109|    995|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 995]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|    995|  const size_t num_entries = point_ids.size();
  113|    995|  const size_t num_values = num_entries * num_components;
  114|    995|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|    995|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|    995|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 0, False: 995]
  ------------------
  117|      0|    return false;
  118|      0|  }
  119|    995|  uint8_t compressed;
  120|    995|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 0, False: 995]
  ------------------
  121|      0|    return false;
  122|      0|  }
  123|    995|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 54, False: 941]
  ------------------
  124|       |    // Decode compressed values.
  125|     54|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 29, False: 25]
  ------------------
  126|     54|                       in_buffer,
  127|     54|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|     29|      return false;
  129|     29|    }
  130|    941|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|    941|    uint8_t num_bytes;
  134|    941|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 0, False: 941]
  ------------------
  135|      0|      return false;
  136|      0|    }
  137|    941|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 53, False: 888]
  ------------------
  138|     53|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 53]
  ------------------
  139|     53|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|     53|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 5, False: 48]
  ------------------
  143|     53|                             sizeof(int32_t) * num_values)) {
  144|      5|        return false;
  145|      5|      }
  146|    888|    } else {
  147|    888|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 2, False: 886]
  ------------------
  148|    888|          num_bytes * num_values) {
  149|      2|        return false;
  150|      2|      }
  151|    886|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 1, False: 885]
  ------------------
  152|    886|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|      1|        return false;
  154|      1|      }
  155|  3.53M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 3.53M, False: 885]
  ------------------
  156|  3.53M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 3.53M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|  3.53M|      }
  160|    885|    }
  161|    941|  }
  162|       |
  163|    958|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 958, False: 0]
  |  Branch (163:26): [True: 440, False: 518]
  ------------------
  164|    871|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 431, False: 87]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|    871|    ConvertSymbolsToSignedInts(
  167|    871|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|    871|        static_cast<int>(num_values), portable_attribute_data);
  169|    871|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|    958|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 518, False: 440]
  ------------------
  173|    518|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 86, False: 432]
  ------------------
  174|     86|      return false;
  175|     86|    }
  176|       |
  177|    432|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 432, False: 0]
  ------------------
  178|    432|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 34, False: 398]
  ------------------
  179|    432|              portable_attribute_data, portable_attribute_data,
  180|    432|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|     34|        return false;
  182|     34|      }
  183|    432|    }
  184|    432|  }
  185|    838|  return true;
  186|    958|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|     98|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|     98|  switch (attribute()->data_type()) {
  190|      2|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 2, False: 96]
  ------------------
  191|      2|      StoreTypedValues<uint8_t>(num_values);
  192|      2|      break;
  193|     85|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 85, False: 13]
  ------------------
  194|     85|      StoreTypedValues<int8_t>(num_values);
  195|     85|      break;
  196|      2|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 2, False: 96]
  ------------------
  197|      2|      StoreTypedValues<uint16_t>(num_values);
  198|      2|      break;
  199|      7|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 7, False: 91]
  ------------------
  200|      7|      StoreTypedValues<int16_t>(num_values);
  201|      7|      break;
  202|      0|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 0, False: 98]
  ------------------
  203|      0|      StoreTypedValues<uint32_t>(num_values);
  204|      0|      break;
  205|      2|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 2, False: 96]
  ------------------
  206|      2|      StoreTypedValues<int32_t>(num_values);
  207|      2|      break;
  208|      0|    default:
  ------------------
  |  Branch (208:5): [True: 0, False: 98]
  ------------------
  209|      0|      return false;
  210|     98|  }
  211|     98|  return true;
  212|     98|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|    995|    int num_entries, int num_components) {
  237|    995|  GeometryAttribute ga;
  238|    995|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|    995|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|    995|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|    995|  port_att->SetIdentityMapping();
  242|    995|  port_att->Reset(num_entries);
  243|    995|  port_att->set_unique_id(attribute()->unique_id());
  244|    995|  SetPortableAttribute(std::move(port_att));
  245|    995|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|      2|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|      2|  const int num_components = attribute()->num_components();
  217|      2|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|      2|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|      2|      new AttributeTypeT[num_components]);
  220|      2|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|      2|  int val_id = 0;
  222|      2|  int out_byte_pos = 0;
  223|  7.24k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 7.24k, False: 2]
  ------------------
  224|   155k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 148k, False: 7.24k]
  ------------------
  225|   148k|      const AttributeTypeT value =
  226|   148k|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   148k|      att_val[c] = value;
  228|   148k|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  7.24k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  7.24k|    out_byte_pos += entry_size;
  232|  7.24k|  }
  233|      2|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|     85|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     85|  const int num_components = attribute()->num_components();
  217|     85|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     85|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     85|      new AttributeTypeT[num_components]);
  220|     85|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     85|  int val_id = 0;
  222|     85|  int out_byte_pos = 0;
  223|  11.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 11.4k, False: 85]
  ------------------
  224|   793k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 782k, False: 11.4k]
  ------------------
  225|   782k|      const AttributeTypeT value =
  226|   782k|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   782k|      att_val[c] = value;
  228|   782k|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  11.4k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  11.4k|    out_byte_pos += entry_size;
  232|  11.4k|  }
  233|     85|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|      2|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|      2|  const int num_components = attribute()->num_components();
  217|      2|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|      2|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|      2|      new AttributeTypeT[num_components]);
  220|      2|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|      2|  int val_id = 0;
  222|      2|  int out_byte_pos = 0;
  223|     14|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 12, False: 2]
  ------------------
  224|     36|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 24, False: 12]
  ------------------
  225|     24|      const AttributeTypeT value =
  226|     24|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|     24|      att_val[c] = value;
  228|     24|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|     12|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|     12|    out_byte_pos += entry_size;
  232|     12|  }
  233|      2|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|      7|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|      7|  const int num_components = attribute()->num_components();
  217|      7|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|      7|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|      7|      new AttributeTypeT[num_components]);
  220|      7|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|      7|  int val_id = 0;
  222|      7|  int out_byte_pos = 0;
  223|  1.36k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.35k, False: 7]
  ------------------
  224|  4.62k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 3.26k, False: 1.35k]
  ------------------
  225|  3.26k|      const AttributeTypeT value =
  226|  3.26k|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  3.26k|      att_val[c] = value;
  228|  3.26k|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.35k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.35k|    out_byte_pos += entry_size;
  232|  1.35k|  }
  233|      7|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|      2|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|      2|  const int num_components = attribute()->num_components();
  217|      2|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|      2|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|      2|      new AttributeTypeT[num_components]);
  220|      2|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|      2|  int val_id = 0;
  222|      2|  int out_byte_pos = 0;
  223|    139|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 137, False: 2]
  ------------------
  224|  1.41k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 1.28k, False: 137]
  ------------------
  225|  1.28k|      const AttributeTypeT value =
  226|  1.28k|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  1.28k|      att_val[c] = value;
  228|  1.28k|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|    137|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|    137|    out_byte_pos += entry_size;
  232|    137|  }
  233|      2|}

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|   208k|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|   208k|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|   208k|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|   208k|    const int remaining = 32 - num_used_bits_;
   54|   208k|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 198k, False: 9.48k]
  ------------------
   55|   198k|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 102, False: 198k]
  ------------------
   56|    102|        return false;
   57|    102|      }
   58|   198k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   198k|      num_used_bits_ += nbits;
   60|   198k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 6.78k, False: 191k]
  ------------------
   61|  6.78k|        ++pos_;
   62|  6.78k|        num_used_bits_ = 0;
   63|  6.78k|      }
   64|   198k|    } else {
   65|  9.48k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 32, False: 9.45k]
  ------------------
   66|     32|        return false;
   67|     32|      }
   68|  9.45k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  9.45k|      num_used_bits_ = nbits - remaining;
   70|  9.45k|      ++pos_;
   71|  9.45k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  9.45k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  9.45k|    }
   74|   208k|    return true;
   75|   208k|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  2.05M|  bool DecodeNextBit() {
   35|  2.05M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  2.05M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 1.70M, False: 351k]
  ------------------
   37|  1.70M|      return false;
   38|  1.70M|    }
   39|   351k|    const bool bit = *pos_ & selector;
   40|   351k|    ++num_used_bits_;
   41|   351k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 10.9k, False: 340k]
  ------------------
   42|  10.9k|      ++pos_;
   43|  10.9k|      num_used_bits_ = 0;
   44|  10.9k|    }
   45|   351k|    return bit;
   46|  2.05M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    315|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    227|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    204|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  6.46k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 6.27k, False: 191]
  ------------------
   35|  6.27k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 13, False: 6.26k]
  ------------------
   36|     13|        return false;
   37|     13|      }
   38|  6.27k|    }
   39|    191|    return bit_decoder_.StartDecoding(source_buffer);
   40|    204|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.10M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.10M|    uint32_t result = 0;
   49|  12.9M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 10.8M, False: 2.10M]
  ------------------
   50|  10.8M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  10.8M|      result = (result << 1) + bit;
   52|  10.8M|    }
   53|  2.10M|    *value = result;
   54|  2.10M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|    105|  void EndDecoding() {
   57|  3.46k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 3.36k, False: 105]
  ------------------
   58|  3.36k|      folded_number_decoders_[i].EndDecoding();
   59|  3.36k|    }
   60|    105|    bit_decoder_.EndDecoding();
   61|    105|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    227|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  10.3k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  8.49k|                                const uint8_t *const buf, int offset) {
  301|  8.49k|  unsigned x;
  302|  8.49k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 6, False: 8.49k]
  ------------------
  303|      6|    return 1;
  304|      6|  }
  305|  8.49k|  ans->buf = buf;
  306|  8.49k|  x = buf[offset - 1] >> 6;
  307|  8.49k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 7.52k, False: 966]
  ------------------
  308|  7.52k|    ans->buf_offset = offset - 1;
  309|  7.52k|    ans->state = buf[offset - 1] & 0x3F;
  310|  7.52k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 899, False: 67]
  ------------------
  311|    899|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 0, False: 899]
  ------------------
  312|      0|      return 1;
  313|      0|    }
  314|    899|    ans->buf_offset = offset - 2;
  315|    899|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|    899|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 60, False: 7]
  ------------------
  317|     60|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 0, False: 60]
  ------------------
  318|      0|      return 1;
  319|      0|    }
  320|     60|    ans->buf_offset = offset - 3;
  321|     60|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|     60|  } else {
  323|      7|    return 1;
  324|      7|  }
  325|  8.48k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  8.48k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  8.48k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  8.48k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  8.48k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 4, False: 8.47k]
  ------------------
  327|      4|    return 1;
  328|      4|  }
  329|  8.47k|  return 0;
  330|  8.48k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    899|static uint32_t mem_get_le16(const void *vmem) {
   68|    899|  uint32_t val;
   69|    899|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    899|  val = mem[1] << 8;
   72|    899|  val |= mem[0];
   73|    899|  return val;
   74|    899|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|     60|static uint32_t mem_get_le24(const void *vmem) {
   77|     60|  uint32_t val;
   78|     60|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|     60|  val = mem[2] << 16;
   81|     60|  val |= mem[1] << 8;
   82|     60|  val |= mem[0];
   83|     60|  return val;
   84|     60|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|   341M|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|   341M|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|   341M|  unsigned quot, rem, x, xn;
  172|   341M|#endif
  173|   341M|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|   341M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|   341M|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|   682M|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 335M, False: 5.62M]
  |  Branch (174:40): [True: 38.1k, False: 335M]
  ------------------
  175|  38.1k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  38.1k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  38.1k|  }
  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|   341M|  x = ans->state;
  184|   341M|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   341M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|   341M|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   341M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|   341M|  xn = quot * p;
  187|   341M|  val = rem < p;
  188|   341M|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|   682M|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 336M, False: 4.75M]
  |  |  ------------------
  ------------------
  189|   336M|    ans->state = xn + rem;
  190|   336M|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  4.75M|    ans->state = x - xn - p;
  193|  4.75M|  }
  194|   341M|#endif
  195|   341M|  return val;
  196|   341M|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  18.3k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  18.3k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  18.3k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  18.3k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|    294|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|    105|                                       uint32_t num_symbols) {
  482|    105|    lut_table_.resize(rans_precision);
  483|    105|    probability_table_.resize(num_symbols);
  484|    105|    uint32_t cum_prob = 0;
  485|    105|    uint32_t act_prob = 0;
  486|    512|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 429, False: 83]
  ------------------
  487|    429|      probability_table_[i].prob = token_probs[i];
  488|    429|      probability_table_[i].cum_prob = cum_prob;
  489|    429|      cum_prob += token_probs[i];
  490|    429|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 22, False: 407]
  ------------------
  491|     22|        return false;
  492|     22|      }
  493|   242k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 242k, False: 407]
  ------------------
  494|   242k|        lut_table_[j] = i;
  495|   242k|      }
  496|    407|      act_prob = cum_prob;
  497|    407|    }
  498|     83|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 27, False: 56]
  ------------------
  499|     27|      return false;
  500|     27|    }
  501|     56|    return true;
  502|     83|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|     55|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     55|    unsigned x;
  423|     55|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 7, False: 48]
  ------------------
  424|      7|      return 1;
  425|      7|    }
  426|     48|    ans_.buf = buf;
  427|     48|    x = buf[offset - 1] >> 6;
  428|     48|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 28, False: 20]
  ------------------
  429|     28|      ans_.buf_offset = offset - 1;
  430|     28|      ans_.state = buf[offset - 1] & 0x3F;
  431|     28|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 7, False: 13]
  ------------------
  432|      7|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 7]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     13|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 4, False: 9]
  ------------------
  438|      4|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 4]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      9|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 9, False: 0]
  ------------------
  444|      9|      ans_.buf_offset = offset - 4;
  445|      9|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      9|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     48|    ans_.state += l_rans_base;
  450|     48|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     48|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 9, False: 39]
  ------------------
  451|      9|      return 1;
  452|      9|    }
  453|     39|    return 0;
  454|     48|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|     14|static uint32_t mem_get_le16(const void *vmem) {
   68|     14|  uint32_t val;
   69|     14|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|     14|  val = mem[1] << 8;
   72|     14|  val |= mem[0];
   73|     14|  return val;
   74|     14|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|      8|static uint32_t mem_get_le24(const void *vmem) {
   77|      8|  uint32_t val;
   78|      8|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|      8|  val = mem[2] << 16;
   81|      8|  val |= mem[1] << 8;
   82|      8|  val |= mem[0];
   83|      8|  return val;
   84|      8|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|     16|static inline uint32_t mem_get_le32(const void *vmem) {
   87|     16|  uint32_t val;
   88|     16|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|     16|  val = mem[3] << 24;
   91|     16|  val |= mem[2] << 16;
   92|     16|  val |= mem[1] << 8;
   93|     16|  val |= mem[0];
   94|     16|  return val;
   95|     16|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  1.10M|  inline int rans_read() {
  463|  1.10M|    unsigned rem;
  464|  1.10M|    unsigned quo;
  465|  1.10M|    struct rans_dec_sym sym;
  466|  1.10M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 975k, False: 128k]
  |  Branch (466:40): [True: 2.85k, False: 972k]
  ------------------
  467|  2.85k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.85k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.85k|    }
  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|  1.10M|    quo = ans_.state / rans_precision;
  472|  1.10M|    rem = ans_.state % rans_precision;
  473|  1.10M|    fetch_sym(&sym, rem);
  474|  1.10M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  1.10M|    return sym.val;
  476|  1.10M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  1.10M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  1.10M|    uint32_t symbol = lut_table_[rem];
  507|  1.10M|    out->val = symbol;
  508|  1.10M|    out->prob = probability_table_[symbol].prob;
  509|  1.10M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  1.10M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|     30|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|     18|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     14|                                       uint32_t num_symbols) {
  482|     14|    lut_table_.resize(rans_precision);
  483|     14|    probability_table_.resize(num_symbols);
  484|     14|    uint32_t cum_prob = 0;
  485|     14|    uint32_t act_prob = 0;
  486|    344|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 336, False: 8]
  ------------------
  487|    336|      probability_table_[i].prob = token_probs[i];
  488|    336|      probability_table_[i].cum_prob = cum_prob;
  489|    336|      cum_prob += token_probs[i];
  490|    336|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 6, False: 330]
  ------------------
  491|      6|        return false;
  492|      6|      }
  493|  48.2k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 47.9k, False: 330]
  ------------------
  494|  47.9k|        lut_table_[j] = i;
  495|  47.9k|      }
  496|    330|      act_prob = cum_prob;
  497|    330|    }
  498|      8|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 6, False: 2]
  ------------------
  499|      6|      return false;
  500|      6|    }
  501|      2|    return true;
  502|      8|  }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|     23|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|     15|                                       uint32_t num_symbols) {
  482|     15|    lut_table_.resize(rans_precision);
  483|     15|    probability_table_.resize(num_symbols);
  484|     15|    uint32_t cum_prob = 0;
  485|     15|    uint32_t act_prob = 0;
  486|     85|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 71, False: 14]
  ------------------
  487|     71|      probability_table_[i].prob = token_probs[i];
  488|     71|      probability_table_[i].cum_prob = cum_prob;
  489|     71|      cum_prob += token_probs[i];
  490|     71|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 70]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|   458k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 458k, False: 70]
  ------------------
  494|   458k|        lut_table_[j] = i;
  495|   458k|      }
  496|     70|      act_prob = cum_prob;
  497|     70|    }
  498|     14|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 14]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|     14|    return true;
  502|     14|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|      5|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      5|    unsigned x;
  423|      5|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 5]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      5|    ans_.buf = buf;
  427|      5|    x = buf[offset - 1] >> 6;
  428|      5|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1, False: 4]
  ------------------
  429|      1|      ans_.buf_offset = offset - 1;
  430|      1|      ans_.state = buf[offset - 1] & 0x3F;
  431|      4|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 3, False: 1]
  ------------------
  432|      3|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 3]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      3|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 1]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      1|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 1, False: 0]
  ------------------
  444|      1|      ans_.buf_offset = offset - 4;
  445|      1|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      1|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      5|    ans_.state += l_rans_base;
  450|      5|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      5|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 1, False: 4]
  ------------------
  451|      1|      return 1;
  452|      1|    }
  453|      4|    return 0;
  454|      5|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|  51.8k|  inline int rans_read() {
  463|  51.8k|    unsigned rem;
  464|  51.8k|    unsigned quo;
  465|  51.8k|    struct rans_dec_sym sym;
  466|  54.4k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 34.1k, False: 20.2k]
  |  Branch (466:40): [True: 2.56k, False: 31.6k]
  ------------------
  467|  2.56k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.56k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.56k|    }
  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|  51.8k|    quo = ans_.state / rans_precision;
  472|  51.8k|    rem = ans_.state % rans_precision;
  473|  51.8k|    fetch_sym(&sym, rem);
  474|  51.8k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  51.8k|    return sym.val;
  476|  51.8k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|  51.8k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  51.8k|    uint32_t symbol = lut_table_[rem];
  507|  51.8k|    out->val = symbol;
  508|  51.8k|    out->prob = probability_table_[symbol].prob;
  509|  51.8k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  51.8k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|      4|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|     27|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|     15|                                       uint32_t num_symbols) {
  482|     15|    lut_table_.resize(rans_precision);
  483|     15|    probability_table_.resize(num_symbols);
  484|     15|    uint32_t cum_prob = 0;
  485|     15|    uint32_t act_prob = 0;
  486|  1.94k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.94k, False: 5]
  ------------------
  487|  1.94k|      probability_table_[i].prob = token_probs[i];
  488|  1.94k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.94k|      cum_prob += token_probs[i];
  490|  1.94k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 10, False: 1.93k]
  ------------------
  491|     10|        return false;
  492|     10|      }
  493|   473k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 471k, False: 1.93k]
  ------------------
  494|   471k|        lut_table_[j] = i;
  495|   471k|      }
  496|  1.93k|      act_prob = cum_prob;
  497|  1.93k|    }
  498|      5|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 5]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|      5|    return true;
  502|      5|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|      2|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      2|    unsigned x;
  423|      2|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 2]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      2|    ans_.buf = buf;
  427|      2|    x = buf[offset - 1] >> 6;
  428|      2|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1, False: 1]
  ------------------
  429|      1|      ans_.buf_offset = offset - 1;
  430|      1|      ans_.state = buf[offset - 1] & 0x3F;
  431|      1|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 1]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      1|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 1, False: 0]
  ------------------
  438|      1|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 1]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      1|      ans_.buf_offset = offset - 3;
  442|      1|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      1|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      2|    ans_.state += l_rans_base;
  450|      2|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      2|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 2]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      2|    return 0;
  454|      2|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|    115|  inline int rans_read() {
  463|    115|    unsigned rem;
  464|    115|    unsigned quo;
  465|    115|    struct rans_dec_sym sym;
  466|    153|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 38, False: 115]
  |  Branch (466:40): [True: 38, False: 0]
  ------------------
  467|     38|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|     38|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|     38|    }
  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|    115|    quo = ans_.state / rans_precision;
  472|    115|    rem = ans_.state % rans_precision;
  473|    115|    fetch_sym(&sym, rem);
  474|    115|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|    115|    return sym.val;
  476|    115|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|    115|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|    115|    uint32_t symbol = lut_table_[rem];
  507|    115|    out->val = symbol;
  508|    115|    out->prob = probability_table_[symbol].prob;
  509|    115|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|    115|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|      2|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|     10|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|      3|                                       uint32_t num_symbols) {
  482|      3|    lut_table_.resize(rans_precision);
  483|      3|    probability_table_.resize(num_symbols);
  484|      3|    uint32_t cum_prob = 0;
  485|      3|    uint32_t act_prob = 0;
  486|      9|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6, False: 3]
  ------------------
  487|      6|      probability_table_[i].prob = token_probs[i];
  488|      6|      probability_table_[i].cum_prob = cum_prob;
  489|      6|      cum_prob += token_probs[i];
  490|      6|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 0, False: 6]
  ------------------
  491|      0|        return false;
  492|      0|      }
  493|   786k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 786k, False: 6]
  ------------------
  494|   786k|        lut_table_[j] = i;
  495|   786k|      }
  496|      6|      act_prob = cum_prob;
  497|      6|    }
  498|      3|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 3]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|      3|    return true;
  502|      3|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|      2|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      2|    unsigned x;
  423|      2|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 2]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      2|    ans_.buf = buf;
  427|      2|    x = buf[offset - 1] >> 6;
  428|      2|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1, False: 1]
  ------------------
  429|      1|      ans_.buf_offset = offset - 1;
  430|      1|      ans_.state = buf[offset - 1] & 0x3F;
  431|      1|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 1, False: 0]
  ------------------
  432|      1|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 1]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      1|      ans_.buf_offset = offset - 2;
  436|      1|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      1|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 0]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      0|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      2|    ans_.state += l_rans_base;
  450|      2|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      2|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 2]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      2|    return 0;
  454|      2|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  23.3k|  inline int rans_read() {
  463|  23.3k|    unsigned rem;
  464|  23.3k|    unsigned quo;
  465|  23.3k|    struct rans_dec_sym sym;
  466|  24.2k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 986, False: 23.3k]
  |  Branch (466:40): [True: 986, False: 0]
  ------------------
  467|    986|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    986|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    986|    }
  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|  23.3k|    quo = ans_.state / rans_precision;
  472|  23.3k|    rem = ans_.state % rans_precision;
  473|  23.3k|    fetch_sym(&sym, rem);
  474|  23.3k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  23.3k|    return sym.val;
  476|  23.3k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  23.3k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  23.3k|    uint32_t symbol = lut_table_[rem];
  507|  23.3k|    out->val = symbol;
  508|  23.3k|    out->prob = probability_table_[symbol].prob;
  509|  23.3k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  23.3k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|      2|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|     27|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|     11|                                       uint32_t num_symbols) {
  482|     11|    lut_table_.resize(rans_precision);
  483|     11|    probability_table_.resize(num_symbols);
  484|     11|    uint32_t cum_prob = 0;
  485|     11|    uint32_t act_prob = 0;
  486|    367|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 357, False: 10]
  ------------------
  487|    357|      probability_table_[i].prob = token_probs[i];
  488|    357|      probability_table_[i].cum_prob = cum_prob;
  489|    357|      cum_prob += token_probs[i];
  490|    357|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 356]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|  4.78M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 4.78M, False: 356]
  ------------------
  494|  4.78M|        lut_table_[j] = i;
  495|  4.78M|      }
  496|    356|      act_prob = cum_prob;
  497|    356|    }
  498|     10|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 1, False: 9]
  ------------------
  499|      1|      return false;
  500|      1|    }
  501|      9|    return true;
  502|     10|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|      8|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      8|    unsigned x;
  423|      8|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 8]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      8|    ans_.buf = buf;
  427|      8|    x = buf[offset - 1] >> 6;
  428|      8|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 3, False: 5]
  ------------------
  429|      3|      ans_.buf_offset = offset - 1;
  430|      3|      ans_.state = buf[offset - 1] & 0x3F;
  431|      5|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 5]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      5|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 5]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      5|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 5, False: 0]
  ------------------
  444|      5|      ans_.buf_offset = offset - 4;
  445|      5|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      5|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      8|    ans_.state += l_rans_base;
  450|      8|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      8|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 1, False: 7]
  ------------------
  451|      1|      return 1;
  452|      1|    }
  453|      7|    return 0;
  454|      8|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|  80.8k|  inline int rans_read() {
  463|  80.8k|    unsigned rem;
  464|  80.8k|    unsigned quo;
  465|  80.8k|    struct rans_dec_sym sym;
  466|  82.2k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 26.4k, False: 55.8k]
  |  Branch (466:40): [True: 1.39k, False: 25.0k]
  ------------------
  467|  1.39k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.39k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.39k|    }
  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|  80.8k|    quo = ans_.state / rans_precision;
  472|  80.8k|    rem = ans_.state % rans_precision;
  473|  80.8k|    fetch_sym(&sym, rem);
  474|  80.8k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  80.8k|    return sym.val;
  476|  80.8k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|  80.8k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  80.8k|    uint32_t symbol = lut_table_[rem];
  507|  80.8k|    out->val = symbol;
  508|  80.8k|    out->prob = probability_table_[symbol].prob;
  509|  80.8k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  80.8k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|      7|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|     61|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|     34|                                       uint32_t num_symbols) {
  482|     34|    lut_table_.resize(rans_precision);
  483|     34|    probability_table_.resize(num_symbols);
  484|     34|    uint32_t cum_prob = 0;
  485|     34|    uint32_t act_prob = 0;
  486|  1.06k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.04k, False: 28]
  ------------------
  487|  1.04k|      probability_table_[i].prob = token_probs[i];
  488|  1.04k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.04k|      cum_prob += token_probs[i];
  490|  1.04k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 6, False: 1.03k]
  ------------------
  491|      6|        return false;
  492|      6|      }
  493|  30.3M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 30.3M, False: 1.03k]
  ------------------
  494|  30.3M|        lut_table_[j] = i;
  495|  30.3M|      }
  496|  1.03k|      act_prob = cum_prob;
  497|  1.03k|    }
  498|     28|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 28]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|     28|    return true;
  502|     28|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|     10|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     10|    unsigned x;
  423|     10|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 10]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     10|    ans_.buf = buf;
  427|     10|    x = buf[offset - 1] >> 6;
  428|     10|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 3, False: 7]
  ------------------
  429|      3|      ans_.buf_offset = offset - 1;
  430|      3|      ans_.state = buf[offset - 1] & 0x3F;
  431|      7|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 3, False: 4]
  ------------------
  432|      3|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 3]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      4|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 3, False: 1]
  ------------------
  438|      3|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 3]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      3|      ans_.buf_offset = offset - 3;
  442|      3|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      3|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 1, False: 0]
  ------------------
  444|      1|      ans_.buf_offset = offset - 4;
  445|      1|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      1|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     10|    ans_.state += l_rans_base;
  450|     10|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     10|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 10]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|     10|    return 0;
  454|     10|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  3.18M|  inline int rans_read() {
  463|  3.18M|    unsigned rem;
  464|  3.18M|    unsigned quo;
  465|  3.18M|    struct rans_dec_sym sym;
  466|  3.18M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 33.7k, False: 3.15M]
  |  Branch (466:40): [True: 874, False: 32.9k]
  ------------------
  467|    874|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    874|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    874|    }
  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|  3.18M|    quo = ans_.state / rans_precision;
  472|  3.18M|    rem = ans_.state % rans_precision;
  473|  3.18M|    fetch_sym(&sym, rem);
  474|  3.18M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  3.18M|    return sym.val;
  476|  3.18M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  3.18M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  3.18M|    uint32_t symbol = lut_table_[rem];
  507|  3.18M|    out->val = symbol;
  508|  3.18M|    out->prob = probability_table_[symbol].prob;
  509|  3.18M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  3.18M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|     10|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    112|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    112|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    112|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 112]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    112|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    112|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    112|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 8, False: 104]
  ------------------
   67|      8|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 8]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      8|  } else
   72|    104|#endif
   73|    104|  {
   74|    104|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 104]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    104|  }
   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|    112|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 111]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|    111|  probability_table_.resize(num_symbols_);
   86|    111|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 64, False: 47]
  ------------------
   87|     64|    return true;
   88|     64|  }
   89|       |  // Decode the table.
   90|   134k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 134k, False: 32]
  ------------------
   91|   134k|    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|   134k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 3, False: 134k]
  ------------------
   95|      3|      return false;
   96|      3|    }
   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|   134k|    const int token = prob_data & 3;
  102|   134k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 30.9k, False: 103k]
  ------------------
  103|  30.9k|      const uint32_t offset = prob_data >> 2;
  104|  30.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 10, False: 30.8k]
  ------------------
  105|     10|        return false;
  106|     10|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.04M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.01M, False: 30.8k]
  ------------------
  109|  1.01M|        probability_table_[i + j] = 0;
  110|  1.01M|      }
  111|  30.8k|      i += offset;
  112|   103k|    } else {
  113|   103k|      const int extra_bytes = token;
  114|   103k|      uint32_t prob = prob_data >> 2;
  115|   210k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 107k, False: 103k]
  ------------------
  116|   107k|        uint8_t eb;
  117|   107k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 107k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   107k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   107k|      }
  124|   103k|      probability_table_[i] = prob;
  125|   103k|    }
  126|   134k|  }
  127|     32|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 29, False: 3]
  ------------------
  128|     29|    return false;
  129|     29|  }
  130|      3|  return true;
  131|     32|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|     27|    DecoderBuffer *buffer) {
  136|     27|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     27|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     27|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     27|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 23]
  ------------------
  140|      4|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 4]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      4|  } else
  145|     23|#endif
  146|     23|  {
  147|     23|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 23]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     23|  }
  151|     27|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 8, False: 19]
  ------------------
  152|      8|    return false;
  153|      8|  }
  154|     19|  const uint8_t *const data_head =
  155|     19|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     19|  buffer->Advance(bytes_encoded);
  158|     19|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 12]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     12|  return true;
  162|     19|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|     52|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  12.2k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|      3|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      3|  ans_.read_end();
  167|      3|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|     41|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|     41|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     41|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 41]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     41|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     41|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     41|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 19, False: 22]
  ------------------
   67|     19|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 19]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     19|  } else
   72|     22|#endif
   73|     22|  {
   74|     22|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 22]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     22|  }
   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|     41|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 32]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|     32|  probability_table_.resize(num_symbols_);
   86|     32|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 30]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  2.69M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.69M, False: 14]
  ------------------
   91|  2.69M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  2.69M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 7, False: 2.69M]
  ------------------
   95|      7|      return false;
   96|      7|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  2.69M|    const int token = prob_data & 3;
  102|  2.69M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 860k, False: 1.83M]
  ------------------
  103|   860k|      const uint32_t offset = prob_data >> 2;
  104|   860k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 860k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  26.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 25.9M, False: 860k]
  ------------------
  109|  25.9M|        probability_table_[i + j] = 0;
  110|  25.9M|      }
  111|   860k|      i += offset;
  112|  1.83M|    } else {
  113|  1.83M|      const int extra_bytes = token;
  114|  1.83M|      uint32_t prob = prob_data >> 2;
  115|  1.87M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 40.3k, False: 1.83M]
  ------------------
  116|  40.3k|        uint8_t eb;
  117|  40.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 40.3k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  40.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  40.3k|      }
  124|  1.83M|      probability_table_[i] = prob;
  125|  1.83M|    }
  126|  2.69M|  }
  127|     14|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 2]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|      2|  return true;
  131|     14|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|      4|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|      2|    DecoderBuffer *buffer) {
  136|      2|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      2|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 2]
  ------------------
  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|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|      2|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 2]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|    124|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|     47|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|     47|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     47|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 47]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     47|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     47|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     47|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 6, False: 41]
  ------------------
   67|      6|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 6]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      6|  } else
   72|     41|#endif
   73|     41|  {
   74|     41|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 41]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     41|  }
   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|     47|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 43]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|     43|  probability_table_.resize(num_symbols_);
   86|     43|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 41]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   591k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 591k, False: 22]
  ------------------
   91|   591k|    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|   591k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 7, False: 591k]
  ------------------
   95|      7|      return false;
   96|      7|    }
   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|   591k|    const int token = prob_data & 3;
  102|   591k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 240k, False: 350k]
  ------------------
  103|   240k|      const uint32_t offset = prob_data >> 2;
  104|   240k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 6, False: 240k]
  ------------------
  105|      6|        return false;
  106|      6|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.43M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.19M, False: 240k]
  ------------------
  109|  7.19M|        probability_table_[i + j] = 0;
  110|  7.19M|      }
  111|   240k|      i += offset;
  112|   350k|    } else {
  113|   350k|      const int extra_bytes = token;
  114|   350k|      uint32_t prob = prob_data >> 2;
  115|   615k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 264k, False: 350k]
  ------------------
  116|   264k|        uint8_t eb;
  117|   264k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 264k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   264k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   264k|      }
  124|   350k|      probability_table_[i] = prob;
  125|   350k|    }
  126|   591k|  }
  127|     22|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 21]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|     21|  return true;
  131|     22|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|     23|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|     21|    DecoderBuffer *buffer) {
  136|     21|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     21|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     21|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     21|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 19]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      2|  } else
  145|     19|#endif
  146|     19|  {
  147|     19|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 19]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     19|  }
  151|     21|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 4, False: 17]
  ------------------
  152|      4|    return false;
  153|      4|  }
  154|     17|  const uint8_t *const data_head =
  155|     17|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     17|  buffer->Advance(bytes_encoded);
  158|     17|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 6, False: 11]
  ------------------
  159|      6|    return false;
  160|      6|  }
  161|     11|  return true;
  162|     17|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|   274k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|     11|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     11|  ans_.read_end();
  167|     11|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|     15|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|     15|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     15|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 15]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     15|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     15|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     15|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 5]
  ------------------
   67|     10|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 10]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     10|  } else
   72|      5|#endif
   73|      5|  {
   74|      5|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 5]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      5|  }
   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|     15|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 15]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     15|  probability_table_.resize(num_symbols_);
   86|     15|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 14]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|    940|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 929, False: 11]
  ------------------
   91|    929|    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|    929|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 929]
  ------------------
   95|      0|      return false;
   96|      0|    }
   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|    929|    const int token = prob_data & 3;
  102|    929|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 267, False: 662]
  ------------------
  103|    267|      const uint32_t offset = prob_data >> 2;
  104|    267|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 264]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.47k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.20k, False: 264]
  ------------------
  109|  8.20k|        probability_table_[i + j] = 0;
  110|  8.20k|      }
  111|    264|      i += offset;
  112|    662|    } else {
  113|    662|      const int extra_bytes = token;
  114|    662|      uint32_t prob = prob_data >> 2;
  115|    972|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 310, False: 662]
  ------------------
  116|    310|        uint8_t eb;
  117|    310|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 310]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|    310|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|    310|      }
  124|    662|      probability_table_[i] = prob;
  125|    662|    }
  126|    929|  }
  127|     11|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 10]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|     10|  return true;
  131|     11|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|     11|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|     10|    DecoderBuffer *buffer) {
  136|     10|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     10|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     10|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     10|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 10, False: 0]
  ------------------
  140|     10|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 10]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     10|  } else
  145|      0|#endif
  146|      0|  {
  147|      0|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 0]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      0|  }
  151|     10|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 6, False: 4]
  ------------------
  152|      6|    return false;
  153|      6|  }
  154|      4|  const uint8_t *const data_head =
  155|      4|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      4|  buffer->Advance(bytes_encoded);
  158|      4|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 3]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      3|  return true;
  162|      4|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|     18|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|      3|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      3|  ans_.read_end();
  167|      3|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|     10|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|     10|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     10|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 10]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     10|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     10|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     10|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 10]
  ------------------
   67|      0|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 0]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      0|  } else
   72|     10|#endif
   73|     10|  {
   74|     10|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 10]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     10|  }
   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|     10|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 10]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     10|  probability_table_.resize(num_symbols_);
   86|     10|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 10]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  8.19k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 8.18k, False: 6]
  ------------------
   91|  8.18k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  8.18k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 8.18k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   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|  8.18k|    const int token = prob_data & 3;
  102|  8.18k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 379, False: 7.80k]
  ------------------
  103|    379|      const uint32_t offset = prob_data >> 2;
  104|    379|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 375]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  11.2k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 10.9k, False: 375]
  ------------------
  109|  10.9k|        probability_table_[i + j] = 0;
  110|  10.9k|      }
  111|    375|      i += offset;
  112|  7.80k|    } else {
  113|  7.80k|      const int extra_bytes = token;
  114|  7.80k|      uint32_t prob = prob_data >> 2;
  115|  12.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.42k, False: 7.80k]
  ------------------
  116|  4.42k|        uint8_t eb;
  117|  4.42k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 4.42k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.42k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.42k|      }
  124|  7.80k|      probability_table_[i] = prob;
  125|  7.80k|    }
  126|  8.18k|  }
  127|      6|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 5]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      5|  return true;
  131|      6|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|      5|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|      5|    DecoderBuffer *buffer) {
  136|      5|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      5|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      5|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      5|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 5]
  ------------------
  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|      5|#endif
  146|      5|  {
  147|      5|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 5]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      5|  }
  151|      5|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 5]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      5|  const uint8_t *const data_head =
  155|      5|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      5|  buffer->Advance(bytes_encoded);
  158|      5|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 5]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      5|  return true;
  162|      5|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  27.6k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|      5|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      5|  ans_.read_end();
  167|      5|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|     14|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|     14|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     14|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 14]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     14|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     14|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     14|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 9, False: 5]
  ------------------
   67|      9|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 9]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      9|  } else
   72|      5|#endif
   73|      5|  {
   74|      5|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 5]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      5|  }
   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|     14|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 14]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     14|  probability_table_.resize(num_symbols_);
   86|     14|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 14]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  15.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 15.0k, False: 10]
  ------------------
   91|  15.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|  15.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 14.9k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  14.9k|    const int token = prob_data & 3;
  102|  14.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.40k, False: 11.5k]
  ------------------
  103|  3.40k|      const uint32_t offset = prob_data >> 2;
  104|  3.40k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 0, False: 3.40k]
  ------------------
  105|      0|        return false;
  106|      0|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   111k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 108k, False: 3.40k]
  ------------------
  109|   108k|        probability_table_[i + j] = 0;
  110|   108k|      }
  111|  3.40k|      i += offset;
  112|  11.5k|    } else {
  113|  11.5k|      const int extra_bytes = token;
  114|  11.5k|      uint32_t prob = prob_data >> 2;
  115|  23.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 11.5k, False: 11.5k]
  ------------------
  116|  11.5k|        uint8_t eb;
  117|  11.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 11.5k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  11.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  11.5k|      }
  124|  11.5k|      probability_table_[i] = prob;
  125|  11.5k|    }
  126|  14.9k|  }
  127|     10|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 6]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|      6|  return true;
  131|     10|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|      6|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|      6|    DecoderBuffer *buffer) {
  136|      6|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      6|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      6|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      6|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 3]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|      3|#endif
  146|      3|  {
  147|      3|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 3]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      3|  }
  151|      6|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 3]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|      3|  const uint8_t *const data_head =
  155|      3|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      3|  buffer->Advance(bytes_encoded);
  158|      3|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 2]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      2|  return true;
  162|      3|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|   747k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|     32|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|     32|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     32|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 32]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     32|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     32|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     32|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 17, False: 15]
  ------------------
   67|     17|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 17]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     17|  } else
   72|     15|#endif
   73|     15|  {
   74|     15|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 15]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     15|  }
   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|     32|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 29]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|     29|  probability_table_.resize(num_symbols_);
   86|     29|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 29]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  1.21M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.21M, False: 4]
  ------------------
   91|  1.21M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.21M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 17, False: 1.21M]
  ------------------
   95|     17|      return false;
   96|     17|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.21M|    const int token = prob_data & 3;
  102|  1.21M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 283k, False: 934k]
  ------------------
  103|   283k|      const uint32_t offset = prob_data >> 2;
  104|   283k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 6, False: 283k]
  ------------------
  105|      6|        return false;
  106|      6|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.48M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.20M, False: 283k]
  ------------------
  109|  8.20M|        probability_table_[i + j] = 0;
  110|  8.20M|      }
  111|   283k|      i += offset;
  112|   934k|    } else {
  113|   934k|      const int extra_bytes = token;
  114|   934k|      uint32_t prob = prob_data >> 2;
  115|  1.57M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 639k, False: 934k]
  ------------------
  116|   639k|        uint8_t eb;
  117|   639k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 639k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   639k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   639k|      }
  124|   934k|      probability_table_[i] = prob;
  125|   934k|    }
  126|  1.21M|  }
  127|      4|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 4]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|      4|  return true;
  131|      4|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|      4|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|      4|    DecoderBuffer *buffer) {
  136|      4|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 4]
  ------------------
  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|      4|#endif
  146|      4|  {
  147|      4|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 4]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      4|  }
  151|      4|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 3]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      3|  const uint8_t *const data_head =
  155|      3|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      3|  buffer->Advance(bytes_encoded);
  158|      3|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 2]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      2|  return true;
  162|      3|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  27.5k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|     23|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|     23|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     23|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 23]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     23|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     23|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     23|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 8]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 15]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     15|  } else
   72|      8|#endif
   73|      8|  {
   74|      8|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 8]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      8|  }
   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|     23|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 19]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|     19|  probability_table_.resize(num_symbols_);
   86|     19|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 19]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   324k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 324k, False: 6]
  ------------------
   91|   324k|    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|   324k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 6, False: 324k]
  ------------------
   95|      6|      return false;
   96|      6|    }
   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|   324k|    const int token = prob_data & 3;
  102|   324k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 104k, False: 220k]
  ------------------
  103|   104k|      const uint32_t offset = prob_data >> 2;
  104|   104k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 104k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.67M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.56M, False: 104k]
  ------------------
  109|  3.56M|        probability_table_[i + j] = 0;
  110|  3.56M|      }
  111|   104k|      i += offset;
  112|   220k|    } else {
  113|   220k|      const int extra_bytes = token;
  114|   220k|      uint32_t prob = prob_data >> 2;
  115|   380k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 160k, False: 220k]
  ------------------
  116|   160k|        uint8_t eb;
  117|   160k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 160k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   160k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   160k|      }
  124|   220k|      probability_table_[i] = prob;
  125|   220k|    }
  126|   324k|  }
  127|      6|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 5]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      5|  return true;
  131|      6|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|      5|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|      5|    DecoderBuffer *buffer) {
  136|      5|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      5|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      5|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      5|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 3]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      2|  } else
  145|      3|#endif
  146|      3|  {
  147|      3|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 3]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      3|  }
  151|      5|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 2]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  13.0k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|     18|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|     18|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     18|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 18]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     18|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     18|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     18|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 6, False: 12]
  ------------------
   67|      6|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 6]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      6|  } else
   72|     12|#endif
   73|     12|  {
   74|     12|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 12]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     12|  }
   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|     18|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 18]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     18|  probability_table_.resize(num_symbols_);
   86|     18|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 18]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  8.14k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 8.12k, False: 14]
  ------------------
   91|  8.12k|    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|  8.12k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 8.12k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   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|  8.12k|    const int token = prob_data & 3;
  102|  8.12k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.12k, False: 6.00k]
  ------------------
  103|  2.12k|      const uint32_t offset = prob_data >> 2;
  104|  2.12k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 2.12k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  57.0k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 54.9k, False: 2.12k]
  ------------------
  109|  54.9k|        probability_table_[i + j] = 0;
  110|  54.9k|      }
  111|  2.12k|      i += offset;
  112|  6.00k|    } else {
  113|  6.00k|      const int extra_bytes = token;
  114|  6.00k|      uint32_t prob = prob_data >> 2;
  115|  10.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.17k, False: 6.00k]
  ------------------
  116|  4.17k|        uint8_t eb;
  117|  4.17k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 4.17k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.17k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.17k|      }
  124|  6.00k|      probability_table_[i] = prob;
  125|  6.00k|    }
  126|  8.12k|  }
  127|     14|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 2]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|      2|  return true;
  131|     14|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|      2|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|      2|    DecoderBuffer *buffer) {
  136|      2|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      2|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 2]
  ------------------
  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|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|      2|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 2, False: 0]
  ------------------
  152|      2|    return false;
  153|      2|  }
  154|      0|  const uint8_t *const data_head =
  155|      0|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      0|  buffer->Advance(bytes_encoded);
  158|      0|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 0]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      0|  return true;
  162|      0|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|     23|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|     23|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     23|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 23]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     23|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     23|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     23|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 23]
  ------------------
   67|      0|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 0]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      0|  } else
   72|     23|#endif
   73|     23|  {
   74|     23|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 23]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     23|  }
   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|     23|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 23]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     23|  probability_table_.resize(num_symbols_);
   86|     23|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 23]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   160k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 160k, False: 15]
  ------------------
   91|   160k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   160k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 160k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   160k|    const int token = prob_data & 3;
  102|   160k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 58.3k, False: 102k]
  ------------------
  103|  58.3k|      const uint32_t offset = prob_data >> 2;
  104|  58.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 58.3k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.07M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.01M, False: 58.3k]
  ------------------
  109|  2.01M|        probability_table_[i + j] = 0;
  110|  2.01M|      }
  111|  58.3k|      i += offset;
  112|   102k|    } else {
  113|   102k|      const int extra_bytes = token;
  114|   102k|      uint32_t prob = prob_data >> 2;
  115|   187k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 84.6k, False: 102k]
  ------------------
  116|  84.6k|        uint8_t eb;
  117|  84.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 84.6k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  84.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  84.6k|      }
  124|   102k|      probability_table_[i] = prob;
  125|   102k|    }
  126|   160k|  }
  127|     15|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 14]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|     14|  return true;
  131|     15|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     14|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     14|    DecoderBuffer *buffer) {
  136|     14|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     14|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     14|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     14|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 14]
  ------------------
  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|     14|#endif
  146|     14|  {
  147|     14|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 14]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     14|  }
  151|     14|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 5]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|      5|  const uint8_t *const data_head =
  155|      5|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      5|  buffer->Advance(bytes_encoded);
  158|      5|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 4]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      4|  return true;
  162|      5|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|  51.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|      4|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      4|  ans_.read_end();
  167|      4|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|     27|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|     27|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     27|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 27]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     27|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     27|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     27|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 18, False: 9]
  ------------------
   67|     18|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 18]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     18|  } else
   72|      9|#endif
   73|      9|  {
   74|      9|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 9]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      9|  }
   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|     27|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 27]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     27|  probability_table_.resize(num_symbols_);
   86|     27|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 27]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  54.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 54.8k, False: 15]
  ------------------
   91|  54.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|  54.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 54.8k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  54.8k|    const int token = prob_data & 3;
  102|  54.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 24.0k, False: 30.7k]
  ------------------
  103|  24.0k|      const uint32_t offset = prob_data >> 2;
  104|  24.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 9, False: 24.0k]
  ------------------
  105|      9|        return false;
  106|      9|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.15M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.13M, False: 24.0k]
  ------------------
  109|  1.13M|        probability_table_[i + j] = 0;
  110|  1.13M|      }
  111|  24.0k|      i += offset;
  112|  30.7k|    } else {
  113|  30.7k|      const int extra_bytes = token;
  114|  30.7k|      uint32_t prob = prob_data >> 2;
  115|  50.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 19.9k, False: 30.7k]
  ------------------
  116|  19.9k|        uint8_t eb;
  117|  19.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 19.9k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  19.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  19.9k|      }
  124|  30.7k|      probability_table_[i] = prob;
  125|  30.7k|    }
  126|  54.8k|  }
  127|     15|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 5]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|      5|  return true;
  131|     15|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|      5|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|      5|    DecoderBuffer *buffer) {
  136|      5|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      5|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      5|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      5|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 5]
  ------------------
  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|      5|#endif
  146|      5|  {
  147|      5|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 5]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      5|  }
  151|      5|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 2]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|    115|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|     10|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|     10|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     10|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 10]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     10|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     10|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     10|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 8]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 2]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      2|  } else
   72|      8|#endif
   73|      8|  {
   74|      8|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 8]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      8|  }
   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|     10|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 10]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     10|  probability_table_.resize(num_symbols_);
   86|     10|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 10]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  37.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 37.6k, False: 3]
  ------------------
   91|  37.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|  37.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 4, False: 37.6k]
  ------------------
   95|      4|      return false;
   96|      4|    }
   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|  37.6k|    const int token = prob_data & 3;
  102|  37.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.27k, False: 33.3k]
  ------------------
  103|  4.27k|      const uint32_t offset = prob_data >> 2;
  104|  4.27k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 4.27k]
  ------------------
  105|      1|        return false;
  106|      1|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   170k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 165k, False: 4.27k]
  ------------------
  109|   165k|        probability_table_[i + j] = 0;
  110|   165k|      }
  111|  4.27k|      i += offset;
  112|  33.3k|    } else {
  113|  33.3k|      const int extra_bytes = token;
  114|  33.3k|      uint32_t prob = prob_data >> 2;
  115|  42.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.80k, False: 33.3k]
  ------------------
  116|  8.80k|        uint8_t eb;
  117|  8.80k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 8.80k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.80k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.80k|      }
  124|  33.3k|      probability_table_[i] = prob;
  125|  33.3k|    }
  126|  37.6k|  }
  127|      3|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 3]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|      3|  return true;
  131|      3|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|      3|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|      3|    DecoderBuffer *buffer) {
  136|      3|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      3|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      3|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      3|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 3]
  ------------------
  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|      3|#endif
  146|      3|  {
  147|      3|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 3]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      3|  }
  151|      3|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 2]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  23.3k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|     27|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|     27|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     27|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 27]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     27|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     27|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     27|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 25]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 2]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      2|  } else
   72|     25|#endif
   73|     25|  {
   74|     25|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 25]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     25|  }
   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|     27|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 25]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|     25|  probability_table_.resize(num_symbols_);
   86|     25|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 24]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   305k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 305k, False: 11]
  ------------------
   91|   305k|    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|   305k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 8, False: 305k]
  ------------------
   95|      8|      return false;
   96|      8|    }
   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|   305k|    const int token = prob_data & 3;
  102|   305k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 79.0k, False: 226k]
  ------------------
  103|  79.0k|      const uint32_t offset = prob_data >> 2;
  104|  79.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 79.0k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.73M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.65M, False: 79.0k]
  ------------------
  109|  2.65M|        probability_table_[i + j] = 0;
  110|  2.65M|      }
  111|  79.0k|      i += offset;
  112|   226k|    } else {
  113|   226k|      const int extra_bytes = token;
  114|   226k|      uint32_t prob = prob_data >> 2;
  115|   402k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 176k, False: 226k]
  ------------------
  116|   176k|        uint8_t eb;
  117|   176k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 176k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   176k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   176k|      }
  124|   226k|      probability_table_[i] = prob;
  125|   226k|    }
  126|   305k|  }
  127|     11|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 9]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      9|  return true;
  131|     11|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     10|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|      9|    DecoderBuffer *buffer) {
  136|      9|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      9|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      9|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      9|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 9]
  ------------------
  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|      9|#endif
  146|      9|  {
  147|      9|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 9]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      9|  }
  151|      9|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 8]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      8|  const uint8_t *const data_head =
  155|      8|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      8|  buffer->Advance(bytes_encoded);
  158|      8|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 7]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      7|  return true;
  162|      8|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|  80.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|      7|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      7|  ans_.read_end();
  167|      7|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|     17|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|     17|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     17|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 17]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     17|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     17|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     17|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 8, False: 9]
  ------------------
   67|      8|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 8]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      8|  } else
   72|      9|#endif
   73|      9|  {
   74|      9|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 9]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      9|  }
   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|     17|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 17]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     17|  probability_table_.resize(num_symbols_);
   86|     17|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 17]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   221k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 221k, False: 6]
  ------------------
   91|   221k|    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|   221k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 2, False: 221k]
  ------------------
   95|      2|      return false;
   96|      2|    }
   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|   221k|    const int token = prob_data & 3;
  102|   221k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 87.5k, False: 134k]
  ------------------
  103|  87.5k|      const uint32_t offset = prob_data >> 2;
  104|  87.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 87.5k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.33M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.24M, False: 87.5k]
  ------------------
  109|  4.24M|        probability_table_[i + j] = 0;
  110|  4.24M|      }
  111|  87.5k|      i += offset;
  112|   134k|    } else {
  113|   134k|      const int extra_bytes = token;
  114|   134k|      uint32_t prob = prob_data >> 2;
  115|   222k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 88.3k, False: 134k]
  ------------------
  116|  88.3k|        uint8_t eb;
  117|  88.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 88.3k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  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|   134k|      probability_table_[i] = prob;
  125|   134k|    }
  126|   221k|  }
  127|      6|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 3]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|      3|  return true;
  131|      6|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|      3|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|      3|    DecoderBuffer *buffer) {
  136|      3|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      3|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      3|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      3|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 3]
  ------------------
  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|      3|#endif
  146|      3|  {
  147|      3|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 3]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      3|  }
  151|      3|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 2]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  12.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|     14|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|     14|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     14|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 14]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     14|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     14|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     14|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 4, False: 10]
  ------------------
   67|      4|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 4]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      4|  } else
   72|     10|#endif
   73|     10|  {
   74|     10|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 10]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     10|  }
   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|     14|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 14]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     14|  probability_table_.resize(num_symbols_);
   86|     14|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 14]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   159k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 159k, False: 6]
  ------------------
   91|   159k|    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|   159k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 5, False: 159k]
  ------------------
   95|      5|      return false;
   96|      5|    }
   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|   159k|    const int token = prob_data & 3;
  102|   159k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 45.4k, False: 114k]
  ------------------
  103|  45.4k|      const uint32_t offset = prob_data >> 2;
  104|  45.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 45.4k]
  ------------------
  105|      1|        return false;
  106|      1|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.12M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.07M, False: 45.4k]
  ------------------
  109|  2.07M|        probability_table_[i + j] = 0;
  110|  2.07M|      }
  111|  45.4k|      i += offset;
  112|   114k|    } else {
  113|   114k|      const int extra_bytes = token;
  114|   114k|      uint32_t prob = prob_data >> 2;
  115|   238k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 124k, False: 114k]
  ------------------
  116|   124k|        uint8_t eb;
  117|   124k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 124k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   124k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   124k|      }
  124|   114k|      probability_table_[i] = prob;
  125|   114k|    }
  126|   159k|  }
  127|      6|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 4]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      4|  return true;
  131|      6|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|      4|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|      4|    DecoderBuffer *buffer) {
  136|      4|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 2]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      2|  } else
  145|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|      4|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 2, False: 2]
  ------------------
  152|      2|    return false;
  153|      2|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  24.5k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|      5|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|      5|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      5|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 5]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      5|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      5|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      5|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 3]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 2]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      2|  } else
   72|      3|#endif
   73|      3|  {
   74|      3|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 3]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      3|  }
   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|      5|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 5]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      5|  probability_table_.resize(num_symbols_);
   86|      5|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 5]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  3.99k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.99k, False: 3]
  ------------------
   91|  3.99k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  3.99k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 3.98k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  3.98k|    const int token = prob_data & 3;
  102|  3.98k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.13k, False: 2.85k]
  ------------------
  103|  1.13k|      const uint32_t offset = prob_data >> 2;
  104|  1.13k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 1.13k]
  ------------------
  105|      1|        return false;
  106|      1|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  36.3k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 35.2k, False: 1.13k]
  ------------------
  109|  35.2k|        probability_table_[i + j] = 0;
  110|  35.2k|      }
  111|  1.13k|      i += offset;
  112|  2.85k|    } else {
  113|  2.85k|      const int extra_bytes = token;
  114|  2.85k|      uint32_t prob = prob_data >> 2;
  115|  4.83k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.97k, False: 2.85k]
  ------------------
  116|  1.97k|        uint8_t eb;
  117|  1.97k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 1.97k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.97k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.97k|      }
  124|  2.85k|      probability_table_[i] = prob;
  125|  2.85k|    }
  126|  3.98k|  }
  127|      3|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 3]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|      3|  return true;
  131|      3|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|      3|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|      3|    DecoderBuffer *buffer) {
  136|      3|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      3|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      3|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      3|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 1]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      2|  } else
  145|      1|#endif
  146|      1|  {
  147|      1|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      1|  }
  151|      3|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 0]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|      0|  const uint8_t *const data_head =
  155|      0|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      0|  buffer->Advance(bytes_encoded);
  158|      0|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 0]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      0|  return true;
  162|      0|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|     12|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|     12|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     12|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 12]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     12|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     12|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     12|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 1, False: 11]
  ------------------
   67|      1|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 1]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      1|  } else
   72|     11|#endif
   73|     11|  {
   74|     11|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 11]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     11|  }
   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|     12|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 12]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     12|  probability_table_.resize(num_symbols_);
   86|     12|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 12]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|    298|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 287, False: 11]
  ------------------
   91|    287|    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|    287|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 287]
  ------------------
   95|      0|      return false;
   96|      0|    }
   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|    287|    const int token = prob_data & 3;
  102|    287|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 137, False: 150]
  ------------------
  103|    137|      const uint32_t offset = prob_data >> 2;
  104|    137|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 136]
  ------------------
  105|      1|        return false;
  106|      1|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  6.92k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.79k, False: 136]
  ------------------
  109|  6.79k|        probability_table_[i + j] = 0;
  110|  6.79k|      }
  111|    136|      i += offset;
  112|    150|    } else {
  113|    150|      const int extra_bytes = token;
  114|    150|      uint32_t prob = prob_data >> 2;
  115|    278|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 128, False: 150]
  ------------------
  116|    128|        uint8_t eb;
  117|    128|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 128]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|    128|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|    128|      }
  124|    150|      probability_table_[i] = prob;
  125|    150|    }
  126|    287|  }
  127|     11|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 10]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|     10|  return true;
  131|     11|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|     10|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|     10|    DecoderBuffer *buffer) {
  136|     10|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     10|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     10|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     10|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 9]
  ------------------
  140|      1|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      1|  } else
  145|      9|#endif
  146|      9|  {
  147|      9|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 9]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      9|  }
  151|     10|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 6, False: 4]
  ------------------
  152|      6|    return false;
  153|      6|  }
  154|      4|  const uint8_t *const data_head =
  155|      4|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      4|  buffer->Advance(bytes_encoded);
  158|      4|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 4]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      4|  return true;
  162|      4|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  5.78k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|      4|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      4|  ans_.read_end();
  167|      4|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|     13|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|     13|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     13|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 13]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     13|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     13|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     13|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 8, False: 5]
  ------------------
   67|      8|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 8]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      8|  } else
   72|      5|#endif
   73|      5|  {
   74|      5|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 5]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      5|  }
   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|     13|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 13]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     13|  probability_table_.resize(num_symbols_);
   86|     13|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 13]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   156k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 156k, False: 8]
  ------------------
   91|   156k|    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|   156k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 156k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   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|   156k|    const int token = prob_data & 3;
  102|   156k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 125k, False: 30.5k]
  ------------------
  103|   125k|      const uint32_t offset = prob_data >> 2;
  104|   125k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 125k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   897k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 771k, False: 125k]
  ------------------
  109|   771k|        probability_table_[i + j] = 0;
  110|   771k|      }
  111|   125k|      i += offset;
  112|   125k|    } else {
  113|  30.5k|      const int extra_bytes = token;
  114|  30.5k|      uint32_t prob = prob_data >> 2;
  115|  72.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 42.3k, False: 30.5k]
  ------------------
  116|  42.3k|        uint8_t eb;
  117|  42.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 42.3k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  42.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  42.3k|      }
  124|  30.5k|      probability_table_[i] = prob;
  125|  30.5k|    }
  126|   156k|  }
  127|      8|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 8]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|      8|  return true;
  131|      8|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|      8|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|      8|    DecoderBuffer *buffer) {
  136|      8|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      8|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      8|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      8|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 6, False: 2]
  ------------------
  140|      6|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 6]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      6|  } else
  145|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|      8|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 6, False: 2]
  ------------------
  152|      6|    return false;
  153|      6|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  3.14M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|    635|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|    635|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 0, False: 635]
  ------------------
   35|      0|    return true;
   36|      0|  }
   37|       |  // Decode which scheme to use.
   38|    635|  uint8_t scheme;
   39|    635|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 635]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    635|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 69, False: 566]
  ------------------
   43|     69|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|     69|                                                  src_buffer, out_values);
   45|    566|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 402, False: 164]
  ------------------
   46|    402|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|    402|                                               out_values);
   48|    402|  }
   49|    164|  return false;
   50|    635|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|     69|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|     69|  SymbolDecoderT<5> tag_decoder;
   57|     69|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 45, False: 24]
  ------------------
   58|     45|    return false;
   59|     45|  }
   60|       |
   61|     24|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 15, False: 9]
  ------------------
   62|     15|    return false;
   63|     15|  }
   64|       |
   65|      9|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 9, False: 0]
  |  Branch (65:25): [True: 9, False: 0]
  ------------------
   66|      9|    return false;  // Wrong number of symbols.
   67|      9|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|      0|  src_buffer->StartBitDecoding(false, nullptr);
   72|      0|  int value_id = 0;
   73|      0|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 0, False: 0]
  ------------------
   74|       |    // Decode the tag.
   75|      0|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|      0|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 0, False: 0]
  ------------------
   78|      0|      uint32_t val;
   79|      0|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 0]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|      0|      out_values[value_id++] = val;
   83|      0|    }
   84|      0|  }
   85|      0|  tag_decoder.EndDecoding();
   86|      0|  src_buffer->EndBitDecoding();
   87|      0|  return true;
   88|      0|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|    402|                      uint32_t *out_values) {
  117|    402|  uint8_t max_bit_length;
  118|    402|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 0, False: 402]
  ------------------
  119|      0|    return false;
  120|      0|  }
  121|    402|  switch (max_bit_length) {
  122|     41|    case 1:
  ------------------
  |  Branch (122:5): [True: 41, False: 361]
  ------------------
  123|     41|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|     41|                                                         out_values);
  125|     47|    case 2:
  ------------------
  |  Branch (125:5): [True: 47, False: 355]
  ------------------
  126|     47|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|     47|                                                         out_values);
  128|     15|    case 3:
  ------------------
  |  Branch (128:5): [True: 15, False: 387]
  ------------------
  129|     15|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|     15|                                                         out_values);
  131|     10|    case 4:
  ------------------
  |  Branch (131:5): [True: 10, False: 392]
  ------------------
  132|     10|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|     10|                                                         out_values);
  134|     43|    case 5:
  ------------------
  |  Branch (134:5): [True: 43, False: 359]
  ------------------
  135|     43|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|     43|                                                         out_values);
  137|     14|    case 6:
  ------------------
  |  Branch (137:5): [True: 14, False: 388]
  ------------------
  138|     14|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|     14|                                                         out_values);
  140|     32|    case 7:
  ------------------
  |  Branch (140:5): [True: 32, False: 370]
  ------------------
  141|     32|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|     32|                                                         out_values);
  143|     23|    case 8:
  ------------------
  |  Branch (143:5): [True: 23, False: 379]
  ------------------
  144|     23|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|     23|                                                         out_values);
  146|     18|    case 9:
  ------------------
  |  Branch (146:5): [True: 18, False: 384]
  ------------------
  147|     18|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|     18|                                                         out_values);
  149|     23|    case 10:
  ------------------
  |  Branch (149:5): [True: 23, False: 379]
  ------------------
  150|     23|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|     23|          num_values, src_buffer, out_values);
  152|     27|    case 11:
  ------------------
  |  Branch (152:5): [True: 27, False: 375]
  ------------------
  153|     27|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|     27|          num_values, src_buffer, out_values);
  155|     10|    case 12:
  ------------------
  |  Branch (155:5): [True: 10, False: 392]
  ------------------
  156|     10|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|     10|          num_values, src_buffer, out_values);
  158|     27|    case 13:
  ------------------
  |  Branch (158:5): [True: 27, False: 375]
  ------------------
  159|     27|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|     27|          num_values, src_buffer, out_values);
  161|     17|    case 14:
  ------------------
  |  Branch (161:5): [True: 17, False: 385]
  ------------------
  162|     17|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|     17|          num_values, src_buffer, out_values);
  164|     14|    case 15:
  ------------------
  |  Branch (164:5): [True: 14, False: 388]
  ------------------
  165|     14|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|     14|          num_values, src_buffer, out_values);
  167|      5|    case 16:
  ------------------
  |  Branch (167:5): [True: 5, False: 397]
  ------------------
  168|      5|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|      5|          num_values, src_buffer, out_values);
  170|     12|    case 17:
  ------------------
  |  Branch (170:5): [True: 12, False: 390]
  ------------------
  171|     12|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|     12|          num_values, src_buffer, out_values);
  173|     13|    case 18:
  ------------------
  |  Branch (173:5): [True: 13, False: 389]
  ------------------
  174|     13|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|     13|          num_values, src_buffer, out_values);
  176|     11|    default:
  ------------------
  |  Branch (176:5): [True: 11, False: 391]
  ------------------
  177|     11|      return false;
  178|    402|  }
  179|    402|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|     41|                              uint32_t *out_values) {
   93|     41|  SymbolDecoderT decoder;
   94|     41|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 37, False: 4]
  ------------------
   95|     37|    return false;
   96|     37|  }
   97|       |
   98|      4|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 4, False: 0]
  |  Branch (98:25): [True: 2, False: 2]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|      2|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 2]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|    126|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 124, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|    124|    const uint32_t value = decoder.DecodeSymbol();
  108|    124|    out_values[i] = value;
  109|    124|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|     47|                              uint32_t *out_values) {
   93|     47|  SymbolDecoderT decoder;
   94|     47|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 24, False: 23]
  ------------------
   95|     24|    return false;
   96|     24|  }
   97|       |
   98|     23|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 23, False: 0]
  |  Branch (98:25): [True: 2, False: 21]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|     21|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 10, False: 11]
  ------------------
  103|     10|    return false;
  104|     10|  }
  105|   274k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 274k, False: 11]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   274k|    const uint32_t value = decoder.DecodeSymbol();
  108|   274k|    out_values[i] = value;
  109|   274k|  }
  110|     11|  decoder.EndDecoding();
  111|     11|  return true;
  112|     21|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|     15|                              uint32_t *out_values) {
   93|     15|  SymbolDecoderT decoder;
   94|     15|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 4, False: 11]
  ------------------
   95|      4|    return false;
   96|      4|  }
   97|       |
   98|     11|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 11, False: 0]
  |  Branch (98:25): [True: 1, False: 10]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     10|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 7, False: 3]
  ------------------
  103|      7|    return false;
  104|      7|  }
  105|     21|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 18, False: 3]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|     18|    const uint32_t value = decoder.DecodeSymbol();
  108|     18|    out_values[i] = value;
  109|     18|  }
  110|      3|  decoder.EndDecoding();
  111|      3|  return true;
  112|     10|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|     10|                              uint32_t *out_values) {
   93|     10|  SymbolDecoderT decoder;
   94|     10|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 5, False: 5]
  ------------------
   95|      5|    return false;
   96|      5|  }
   97|       |
   98|      5|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 5, False: 0]
  |  Branch (98:25): [True: 0, False: 5]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      5|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 5]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  27.6k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 27.6k, False: 5]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  27.6k|    const uint32_t value = decoder.DecodeSymbol();
  108|  27.6k|    out_values[i] = value;
  109|  27.6k|  }
  110|      5|  decoder.EndDecoding();
  111|      5|  return true;
  112|      5|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|     43|                              uint32_t *out_values) {
   93|     43|  SymbolDecoderT decoder;
   94|     43|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 0, False: 43]
  ------------------
   95|      0|    return false;
   96|      0|  }
   97|       |
   98|     43|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 43, False: 0]
  |  Branch (98:25): [True: 40, False: 3]
  ------------------
   99|     40|    return false;  // Wrong number of symbols.
  100|     40|  }
  101|       |
  102|      3|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 3]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  12.2k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.2k, False: 3]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.2k|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.2k|    out_values[i] = value;
  109|  12.2k|  }
  110|      3|  decoder.EndDecoding();
  111|      3|  return true;
  112|      3|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|     14|                              uint32_t *out_values) {
   93|     14|  SymbolDecoderT decoder;
   94|     14|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 8, False: 6]
  ------------------
   95|      8|    return false;
   96|      8|  }
   97|       |
   98|      6|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 6, False: 0]
  |  Branch (98:25): [True: 0, False: 6]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      6|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 4, False: 2]
  ------------------
  103|      4|    return false;
  104|      4|  }
  105|   747k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 747k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   747k|    const uint32_t value = decoder.DecodeSymbol();
  108|   747k|    out_values[i] = value;
  109|   747k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      6|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|     32|                              uint32_t *out_values) {
   93|     32|  SymbolDecoderT decoder;
   94|     32|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 28, False: 4]
  ------------------
   95|     28|    return false;
   96|     28|  }
   97|       |
   98|      4|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 4, False: 0]
  |  Branch (98:25): [True: 0, False: 4]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      4|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 2, False: 2]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|  27.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 27.5k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  27.5k|    const uint32_t value = decoder.DecodeSymbol();
  108|  27.5k|    out_values[i] = value;
  109|  27.5k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      4|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|     23|                              uint32_t *out_values) {
   93|     23|  SymbolDecoderT decoder;
   94|     23|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 18, False: 5]
  ------------------
   95|     18|    return false;
   96|     18|  }
   97|       |
   98|      5|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 5, False: 0]
  |  Branch (98:25): [True: 0, False: 5]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      5|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 3, False: 2]
  ------------------
  103|      3|    return false;
  104|      3|  }
  105|  13.0k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 13.0k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  13.0k|    const uint32_t value = decoder.DecodeSymbol();
  108|  13.0k|    out_values[i] = value;
  109|  13.0k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      5|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|     18|                              uint32_t *out_values) {
   93|     18|  SymbolDecoderT decoder;
   94|     18|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 16, False: 2]
  ------------------
   95|     16|    return false;
   96|     16|  }
   97|       |
   98|      2|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 2, False: 0]
  |  Branch (98:25): [True: 0, False: 2]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      2|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 2, False: 0]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|     23|                              uint32_t *out_values) {
   93|     23|  SymbolDecoderT decoder;
   94|     23|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 9, False: 14]
  ------------------
   95|      9|    return false;
   96|      9|  }
   97|       |
   98|     14|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 14, False: 0]
  |  Branch (98:25): [True: 0, False: 14]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     14|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 10, False: 4]
  ------------------
  103|     10|    return false;
  104|     10|  }
  105|  51.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 51.8k, False: 4]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  51.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  51.8k|    out_values[i] = value;
  109|  51.8k|  }
  110|      4|  decoder.EndDecoding();
  111|      4|  return true;
  112|     14|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|     27|                              uint32_t *out_values) {
   93|     27|  SymbolDecoderT decoder;
   94|     27|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 22, False: 5]
  ------------------
   95|     22|    return false;
   96|     22|  }
   97|       |
   98|      5|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 5, False: 0]
  |  Branch (98:25): [True: 0, False: 5]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      5|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 3, False: 2]
  ------------------
  103|      3|    return false;
  104|      3|  }
  105|    117|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 115, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|    115|    const uint32_t value = decoder.DecodeSymbol();
  108|    115|    out_values[i] = value;
  109|    115|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      5|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|     10|                              uint32_t *out_values) {
   93|     10|  SymbolDecoderT decoder;
   94|     10|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 7, False: 3]
  ------------------
   95|      7|    return false;
   96|      7|  }
   97|       |
   98|      3|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 3, False: 0]
  |  Branch (98:25): [True: 0, False: 3]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      3|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 2]
  ------------------
  103|      1|    return false;
  104|      1|  }
  105|  23.3k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 23.3k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  23.3k|    const uint32_t value = decoder.DecodeSymbol();
  108|  23.3k|    out_values[i] = value;
  109|  23.3k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      3|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|     27|                              uint32_t *out_values) {
   93|     27|  SymbolDecoderT decoder;
   94|     27|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 17, False: 10]
  ------------------
   95|     17|    return false;
   96|     17|  }
   97|       |
   98|     10|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 10, False: 0]
  |  Branch (98:25): [True: 1, False: 9]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|      9|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 2, False: 7]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|  80.9k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 80.8k, False: 7]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  80.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  80.8k|    out_values[i] = value;
  109|  80.8k|  }
  110|      7|  decoder.EndDecoding();
  111|      7|  return true;
  112|      9|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|     17|                              uint32_t *out_values) {
   93|     17|  SymbolDecoderT decoder;
   94|     17|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 14, False: 3]
  ------------------
   95|     14|    return false;
   96|     14|  }
   97|       |
   98|      3|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 3, False: 0]
  |  Branch (98:25): [True: 0, False: 3]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      3|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 2]
  ------------------
  103|      1|    return false;
  104|      1|  }
  105|  12.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.8k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.8k|    out_values[i] = value;
  109|  12.8k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      3|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|     14|                              uint32_t *out_values) {
   93|     14|  SymbolDecoderT decoder;
   94|     14|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 10, False: 4]
  ------------------
   95|     10|    return false;
   96|     10|  }
   97|       |
   98|      4|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 4, False: 0]
  |  Branch (98:25): [True: 0, False: 4]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      4|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 2, False: 2]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|  24.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 24.5k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  24.5k|    const uint32_t value = decoder.DecodeSymbol();
  108|  24.5k|    out_values[i] = value;
  109|  24.5k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      4|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|      5|                              uint32_t *out_values) {
   93|      5|  SymbolDecoderT decoder;
   94|      5|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 2, False: 3]
  ------------------
   95|      2|    return false;
   96|      2|  }
   97|       |
   98|      3|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 3, False: 0]
  |  Branch (98:25): [True: 0, False: 3]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      3|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 3, False: 0]
  ------------------
  103|      3|    return false;
  104|      3|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      3|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|     12|                              uint32_t *out_values) {
   93|     12|  SymbolDecoderT decoder;
   94|     12|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 2, False: 10]
  ------------------
   95|      2|    return false;
   96|      2|  }
   97|       |
   98|     10|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 10, False: 0]
  |  Branch (98:25): [True: 0, False: 10]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     10|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 6, False: 4]
  ------------------
  103|      6|    return false;
  104|      6|  }
  105|  5.78k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.78k, False: 4]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.78k|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.78k|    out_values[i] = value;
  109|  5.78k|  }
  110|      4|  decoder.EndDecoding();
  111|      4|  return true;
  112|     10|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|     13|                              uint32_t *out_values) {
   93|     13|  SymbolDecoderT decoder;
   94|     13|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 5, False: 8]
  ------------------
   95|      5|    return false;
   96|      5|  }
   97|       |
   98|      8|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 8, False: 0]
  |  Branch (98:25): [True: 0, False: 8]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      8|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 6, False: 2]
  ------------------
  103|      6|    return false;
  104|      6|  }
  105|  3.14M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.14M, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.14M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.14M|    out_values[i] = value;
  109|  3.14M|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      8|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|    214|    : decoder_(nullptr),
   49|    214|      last_symbol_id_(-1),
   50|    214|      last_vert_id_(-1),
   51|    214|      last_face_id_(-1),
   52|    214|      num_new_vertices_(0),
   53|    214|      num_encoded_vertices_(0),
   54|    214|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|    214|    MeshEdgebreakerDecoder *decoder) {
   59|    214|  decoder_ = decoder;
   60|    214|  return true;
   61|    214|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|    212|    int att_id) const {
   67|    235|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 235, False: 0]
  ------------------
   68|    235|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    235|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 23, False: 212]
  |  Branch (69:27): [True: 0, False: 212]
  ------------------
   70|     23|      continue;
   71|     23|    }
   72|    212|    const AttributesDecoderInterface *const dec =
   73|    212|        decoder_->attributes_decoder(decoder_id);
   74|  1.44k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 1.44k, False: 0]
  ------------------
   75|  1.44k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 212, False: 1.23k]
  ------------------
   76|    212|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 145, False: 67]
  ------------------
   77|    145|          return &attribute_data_[i].connectivity_data;
   78|    145|        }
   79|     67|        return nullptr;
   80|    212|      }
   81|  1.44k|    }
   82|    212|  }
   83|      0|  return nullptr;
   84|    212|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|    212|    int att_id) const {
   90|    235|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 235, False: 0]
  ------------------
   91|    235|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    235|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 23, False: 212]
  |  Branch (92:27): [True: 0, False: 212]
  ------------------
   93|     23|      continue;
   94|     23|    }
   95|    212|    const AttributesDecoderInterface *const dec =
   96|    212|        decoder_->attributes_decoder(decoder_id);
   97|  1.44k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 1.44k, False: 0]
  ------------------
   98|  1.44k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 212, False: 1.23k]
  ------------------
   99|    212|        return &attribute_data_[i].encoding_data;
  100|    212|      }
  101|  1.44k|    }
  102|    212|  }
  103|      0|  return &pos_encoding_data_;
  104|    212|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|    121|    int32_t att_decoder_id) {
  131|    121|  int8_t att_data_id;
  132|    121|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 0, False: 121]
  ------------------
  133|      0|    return false;
  134|      0|  }
  135|    121|  uint8_t decoder_type;
  136|    121|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 0, False: 121]
  ------------------
  137|      0|    return false;
  138|      0|  }
  139|       |
  140|    121|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 120, False: 1]
  ------------------
  141|    120|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 25, False: 95]
  ------------------
  142|     25|      return false;  // Unexpected attribute data.
  143|     25|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|     95|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 0, False: 95]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|       |
  151|     95|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|     95|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|      1|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 0, False: 1]
  ------------------
  155|      0|      return false;  // Some other decoder is already using the data. Error.
  156|      0|    }
  157|      1|    pos_data_decoder_id_ = att_decoder_id;
  158|      1|  }
  159|       |
  160|     96|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|     96|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     96|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 96, False: 0]
  ------------------
  162|     96|    uint8_t traversal_method_encoded;
  163|     96|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 0, False: 96]
  ------------------
  164|      0|      return false;
  165|      0|    }
  166|       |    // Check that decoded traversal method is valid.
  167|     96|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 2, False: 94]
  ------------------
  168|      2|      return false;
  169|      2|    }
  170|     94|    traversal_method =
  171|     94|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|     94|  }
  173|       |
  174|     94|  const Mesh *mesh = decoder_->mesh();
  175|     94|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|     94|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 23, False: 71]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|     23|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|     23|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 0, False: 23]
  ------------------
  182|      0|      encoding_data = &pos_encoding_data_;
  183|     23|    } else {
  184|     23|      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|     23|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     23|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|     23|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 1, False: 22]
  ------------------
  191|      1|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|      1|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|      1|          AttTraverser;
  194|      1|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|     22|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 22, False: 0]
  ------------------
  196|     22|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|     22|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|     22|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|     22|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|     71|  } else {
  203|     71|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 0, False: 71]
  ------------------
  204|      0|      return false;  // Unsupported method.
  205|      0|    }
  206|     71|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 0, False: 71]
  ------------------
  207|      0|      return false;  // Attribute data must be specified.
  208|      0|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     71|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     71|        AttObserver;
  214|     71|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     71|        AttTraverser;
  216|       |
  217|     71|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     71|        &attribute_data_[att_data_id].encoding_data;
  219|     71|    const MeshAttributeCornerTable *const corner_table =
  220|     71|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     71|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     71|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     71|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     71|                             encoding_data);
  227|       |
  228|     71|    AttTraverser att_traverser;
  229|     71|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     71|    traversal_sequencer->SetTraverser(att_traverser);
  232|     71|    sequencer = std::move(traversal_sequencer);
  233|     71|  }
  234|       |
  235|     94|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 94]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|     94|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|     94|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|     94|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|     94|                                        std::move(att_controller));
  244|     94|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|    214|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|    214|  num_new_vertices_ = 0;
  249|    214|  new_to_parent_vertex_map_.clear();
  250|    214|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|    214|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    214|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 59, False: 155]
  ------------------
  252|     59|    uint32_t num_new_verts;
  253|     59|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     59|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 19, False: 40]
  ------------------
  254|     19|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 19]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|     40|    } else {
  258|     40|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 40]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|     40|    }
  262|     59|    num_new_vertices_ = num_new_verts;
  263|     59|  }
  264|    214|#endif
  265|       |
  266|    214|  uint32_t num_encoded_vertices;
  267|    214|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|    214|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    214|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 19, False: 195]
  ------------------
  269|     19|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 19]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|     19|  } else
  274|    195|#endif
  275|    195|  {
  276|    195|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 195]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|    195|  }
  280|    214|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|    214|  uint32_t num_faces;
  283|    214|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|    214|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    214|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 19, False: 195]
  ------------------
  285|     19|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 19]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|     19|  } else
  290|    195|#endif
  291|    195|  {
  292|    195|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 195]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|    195|  }
  296|    214|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 0, False: 214]
  ------------------
  297|      0|    return false;  // Draco cannot handle this many faces.
  298|      0|  }
  299|       |
  300|    214|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 0, False: 214]
  ------------------
  301|      0|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      0|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|    214|  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|    214|  const uint64_t num_encoded_vertices_64 =
  311|    214|      static_cast<uint64_t>(num_encoded_vertices_);
  312|    214|  const uint64_t max_num_vertex_edges =
  313|    214|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|    214|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 0, False: 214]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      0|    return false;
  317|      0|  }
  318|       |
  319|    214|  uint8_t num_attribute_data;
  320|    214|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 214]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|    214|  uint32_t num_encoded_symbols;
  325|    214|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|    214|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    214|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 19, False: 195]
  ------------------
  327|     19|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 19]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|     19|  } else
  332|    195|#endif
  333|    195|  {
  334|    195|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 195]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|    195|  }
  338|       |
  339|    214|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 0, False: 214]
  ------------------
  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|      0|    return false;
  344|      0|  }
  345|    214|  const uint32_t max_encoded_faces =
  346|    214|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|    214|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 1, False: 213]
  ------------------
  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|      1|    return false;
  352|      1|  }
  353|       |
  354|    213|  uint32_t num_encoded_split_symbols;
  355|    213|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|    213|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    213|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 18, False: 195]
  ------------------
  357|     18|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 18]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|     18|  } else
  362|    195|#endif
  363|    195|  {
  364|    195|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 195]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|    195|  }
  368|       |
  369|    213|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 0, False: 213]
  ------------------
  370|      0|    return false;  // Split symbols are a sub-set of all symbols.
  371|      0|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|    213|  vertex_traversal_length_.clear();
  375|    213|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|    213|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 213]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|    213|  processed_corner_ids_.clear();
  380|    213|  processed_corner_ids_.reserve(num_faces);
  381|    213|  processed_connectivity_corners_.clear();
  382|    213|  processed_connectivity_corners_.reserve(num_faces);
  383|    213|  topology_split_data_.clear();
  384|    213|  hole_event_data_.clear();
  385|    213|  init_face_configurations_.clear();
  386|    213|  init_corners_.clear();
  387|       |
  388|    213|  last_symbol_id_ = -1;
  389|    213|  last_face_id_ = -1;
  390|    213|  last_vert_id_ = -1;
  391|       |
  392|    213|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|    213|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|    213|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 213]
  ------------------
  397|    213|          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|    213|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|    213|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|    213|  int32_t topology_split_decoded_bytes = -1;
  410|    213|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    213|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 58, False: 155]
  ------------------
  411|     58|    uint32_t encoded_connectivity_size;
  412|     58|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     58|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 18, False: 40]
  ------------------
  413|     18|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 18]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|     40|    } else {
  417|     40|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 40]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|     40|    }
  421|     58|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 0, False: 58]
  ------------------
  422|     58|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 0, False: 58]
  ------------------
  423|      0|      return false;
  424|      0|    }
  425|     58|    DecoderBuffer event_buffer;
  426|     58|    event_buffer.Init(
  427|     58|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|     58|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|     58|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|     58|    topology_split_decoded_bytes =
  432|     58|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|     58|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 15, False: 43]
  ------------------
  434|     15|      return false;
  435|     15|    }
  436|       |
  437|     58|  } else
  438|    155|#endif
  439|    155|  {
  440|    155|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 0, False: 155]
  ------------------
  441|      0|      return false;
  442|      0|    }
  443|    155|  }
  444|       |
  445|    198|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|    198|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|    198|                                           num_encoded_split_symbols);
  449|    198|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|    198|  DecoderBuffer traversal_end_buffer;
  452|    198|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 7, False: 191]
  ------------------
  453|      7|    return false;
  454|      7|  }
  455|       |
  456|    191|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|    191|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 69, False: 122]
  ------------------
  458|     69|    return false;
  459|     69|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    122|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    122|                           traversal_end_buffer.remaining_size(),
  464|    122|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    122|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    122|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    122|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 37, False: 85]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|     37|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|     37|  }
  471|    122|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    122|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 122, False: 0]
  ------------------
  475|    122|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    122|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    122|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 37, False: 85]
  ------------------
  477|    111|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 74, False: 37]
  ------------------
  478|     74|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 74]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|     74|      }
  482|       |
  483|     37|    } else
  484|     85|#endif
  485|     85|    {
  486|   325k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 324k, False: 85]
  ------------------
  487|   324k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 324k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   324k|      }
  491|     85|    }
  492|    122|  }
  493|    122|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    687|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 565, False: 122]
  ------------------
  498|    565|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  3.42M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 3.42M, False: 565]
  ------------------
  501|  3.42M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  3.42M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    565|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 565]
  ------------------
  505|    565|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    565|  }
  509|       |
  510|    122|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    687|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 565, False: 122]
  ------------------
  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|    565|    int32_t att_connectivity_verts =
  517|    565|        attribute_data_[i].connectivity_data.num_vertices();
  518|    565|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 5, False: 560]
  ------------------
  519|      5|      att_connectivity_verts = corner_table_->num_vertices();
  520|      5|    }
  521|    565|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    565|  }
  523|    122|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 1, False: 121]
  ------------------
  524|      1|    return false;
  525|      1|  }
  526|    121|  return true;
  527|    122|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|      7|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|      7|  return true;
  532|      7|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|    191|    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|    191|  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|    191|  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|    191|  std::vector<VertexIndex> invalid_vertices;
  558|    191|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|    191|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|    191|  int num_faces = 0;
  562|  17.7M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 17.7M, False: 153]
  ------------------
  563|  17.7M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  17.7M|    bool check_topology_split = false;
  566|  17.7M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  17.7M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 8.37M, False: 9.38M]
  ------------------
  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|  8.37M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 8.37M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  8.37M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  8.37M|      const VertexIndex vertex_x =
  593|  8.37M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  8.37M|      const CornerIndex corner_b =
  595|  8.37M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  8.37M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 35, False: 8.37M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     35|        return -1;
  600|     35|      }
  601|  8.37M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 8.37M]
  |  Branch (601:11): [True: 0, False: 8.37M]
  ------------------
  602|  8.37M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 8.37M]
  ------------------
  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|  8.37M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  8.37M|      SetOppositeCorners(corner_a, corner + 1);
  612|  8.37M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  8.37M|      const VertexIndex vert_a_prev =
  616|  8.37M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  8.37M|      const VertexIndex vert_b_next =
  618|  8.37M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  8.37M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 8.37M]
  |  Branch (619:38): [True: 0, False: 8.37M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  8.37M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  8.37M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  8.37M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  8.37M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  8.37M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  8.37M|      active_corner_stack.back() = corner;
  631|  9.38M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 2.30M, False: 7.08M]
  |  Branch (631:40): [True: 857k, False: 6.22M]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  3.15M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 3.15M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  3.15M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  3.15M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 3.15M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  3.15M|      const CornerIndex corner(3 * face.value());
  658|  3.15M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  3.15M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 2.30M, False: 857k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  2.30M|        opp_corner = corner + 2;
  662|  2.30M|        corner_l = corner + 1;
  663|  2.30M|        corner_r = corner;
  664|  2.30M|      } else {
  665|       |        // "l" is the new first corner.
  666|   857k|        opp_corner = corner + 1;
  667|   857k|        corner_l = corner;
  668|   857k|        corner_r = corner + 2;
  669|   857k|      }
  670|  3.15M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  3.15M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  3.15M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 0, False: 3.15M]
  ------------------
  675|      0|        return -1;  // Unexpected number of decoded vertices.
  676|      0|      }
  677|       |
  678|  3.15M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  3.15M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  3.15M|      const VertexIndex vertex_r =
  682|  3.15M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  3.15M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  3.15M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  3.15M|      corner_table_->MapCornerToVertex(
  688|  3.15M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  3.15M|      active_corner_stack.back() = corner;
  690|  3.15M|      check_topology_split = true;
  691|  6.22M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 1.91M, False: 4.31M]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  1.91M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 1.91M]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  1.91M|      const CornerIndex corner_b = active_corner_stack.back();
  706|  1.91M|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  1.91M|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  1.91M|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 0, False: 1.91M]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|      0|        active_corner_stack.push_back(it->second);
  714|      0|      }
  715|  1.91M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 1, False: 1.91M]
  ------------------
  716|      1|        return -1;
  717|      1|      }
  718|  1.91M|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  1.91M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 1.91M]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  1.91M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 0, False: 1.91M]
  |  Branch (724:11): [True: 0, False: 1.91M]
  ------------------
  725|  1.91M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 1.91M]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      0|        return -1;
  729|      0|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  1.91M|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  1.91M|      SetOppositeCorners(corner_a, corner + 2);
  735|  1.91M|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  1.91M|      const VertexIndex vertex_p =
  739|  1.91M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  1.91M|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  1.91M|      corner_table_->MapCornerToVertex(
  742|  1.91M|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  1.91M|      const VertexIndex vert_b_prev =
  744|  1.91M|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  1.91M|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  1.91M|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  1.91M|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  1.91M|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  1.91M|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  1.91M|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  1.91M|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  1.91M|      const CornerIndex first_corner = corner_n;
  757|  11.3M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 9.43M, False: 1.91M]
  ------------------
  758|  9.43M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  9.43M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  9.43M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 0, False: 9.43M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      0|          return -1;
  764|      0|        }
  765|  9.43M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  1.91M|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  1.91M|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 10.7k, False: 1.90M]
  ------------------
  770|  10.7k|        invalid_vertices.push_back(vertex_n);
  771|  10.7k|      }
  772|  1.91M|      active_corner_stack.back() = corner;
  773|  4.31M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 4.31M, False: 0]
  ------------------
  774|  4.31M|      const CornerIndex corner(3 * face.value());
  775|  4.31M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  4.31M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  4.31M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  4.31M|                                       corner_table_->AddNewVertex());
  780|  4.31M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  4.31M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  4.31M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 1, False: 4.31M]
  ------------------
  784|      1|        return -1;  // Unexpected number of decoded vertices.
  785|      1|      }
  786|       |
  787|  4.31M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  4.31M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  4.31M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  4.31M|      active_corner_stack.push_back(corner);
  792|  4.31M|      check_topology_split = true;
  793|  4.31M|    } 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|  17.7M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  17.7M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 7.47M, False: 10.2M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  7.47M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  7.47M|      EdgeFaceName split_edge;
  812|  7.47M|      int encoder_split_symbol_id;
  813|  7.47M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 33, False: 7.47M]
  ------------------
  814|  7.47M|                             &encoder_split_symbol_id)) {
  815|     33|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 1, False: 32]
  ------------------
  816|      1|          return -1;  // Wrong split symbol id.
  817|      1|        }
  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|     32|        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|     32|        CornerIndex new_active_corner;
  831|     32|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 13, False: 19]
  ------------------
  832|     13|          new_active_corner = corner_table_->Next(act_top_corner);
  833|     19|        } else {
  834|     19|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|     19|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|     32|        const int decoder_split_symbol_id =
  839|     32|            num_symbols - encoder_split_symbol_id - 1;
  840|     32|        topology_split_active_corners[decoder_split_symbol_id] =
  841|     32|            new_active_corner;
  842|     32|      }
  843|  7.47M|    }
  844|  17.7M|  }
  845|    153|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 153]
  ------------------
  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|  54.0k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 53.9k, False: 132]
  ------------------
  850|  53.9k|    const CornerIndex corner = active_corner_stack.back();
  851|  53.9k|    active_corner_stack.pop_back();
  852|  53.9k|    const bool interior_face =
  853|  53.9k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  53.9k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 48.3k, False: 5.64k]
  ------------------
  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|  48.3k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 2, False: 48.3k]
  ------------------
  877|      2|        return -1;  // More faces than expected added to the mesh.
  878|      2|      }
  879|       |
  880|  48.3k|      const CornerIndex corner_a = corner;
  881|  48.3k|      const VertexIndex vert_n =
  882|  48.3k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  48.3k|      const CornerIndex corner_b =
  884|  48.3k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  48.3k|      const VertexIndex vert_x =
  887|  48.3k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  48.3k|      const CornerIndex corner_c =
  889|  48.3k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  48.3k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 9, False: 48.3k]
  |  Branch (891:33): [True: 10, False: 48.2k]
  |  Branch (891:55): [True: 0, False: 48.2k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     19|        return -1;
  894|     19|      }
  895|  48.2k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 48.2k]
  |  Branch (895:11): [True: 0, False: 48.2k]
  ------------------
  896|  48.2k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 48.2k]
  ------------------
  897|  48.2k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 48.2k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      0|        return -1;
  901|      0|      }
  902|       |
  903|  48.2k|      const VertexIndex vert_p =
  904|  48.2k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  48.2k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  48.2k|      const CornerIndex new_corner(3 * face.value());
  909|  48.2k|      SetOppositeCorners(new_corner, corner);
  910|  48.2k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  48.2k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  48.2k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  48.2k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  48.2k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|   193k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 144k, False: 48.2k]
  ------------------
  920|   144k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|   144k|      }
  922|       |
  923|  48.2k|      init_face_configurations_.push_back(true);
  924|  48.2k|      init_corners_.push_back(new_corner);
  925|  48.2k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  5.64k|      init_face_configurations_.push_back(false);
  930|  5.64k|      init_corners_.push_back(corner);
  931|  5.64k|    }
  932|  53.9k|  }
  933|    132|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 10, False: 122]
  ------------------
  934|     10|    return -1;  // Unexpected number of decoded faces.
  935|     10|  }
  936|       |
  937|    122|  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|    122|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 0, False: 122]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|      0|    VertexIndex src_vert(num_vertices - 1);
  943|      0|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 0, False: 0]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|      0|      src_vert = VertexIndex(--num_vertices - 1);
  946|      0|    }
  947|      0|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 0, False: 0]
  ------------------
  948|      0|      continue;  // No need to swap anything.
  949|      0|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|      0|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|      0|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 0, False: 0]
  ------------------
  954|      0|      const CornerIndex cid = vcit.Corner();
  955|      0|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 0, False: 0]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      0|        return -1;
  959|      0|      }
  960|      0|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|      0|    }
  962|      0|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|      0|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|      0|    corner_table_->MakeVertexIsolated(src_vert);
  967|      0|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|      0|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|      0|    num_vertices--;
  972|      0|  }
  973|    122|  return num_vertices;
  974|    122|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|    213|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|    213|  uint32_t num_topology_splits;
  982|    213|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|    213|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    213|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 18, False: 195]
  ------------------
  984|     18|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 18]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|     18|  } else
  989|    195|#endif
  990|    195|  {
  991|    195|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 195]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|    195|  }
  995|    213|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 138, False: 75]
  ------------------
  996|    138|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 0, False: 138]
  ------------------
  997|    138|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|      0|      return -1;
  999|      0|    }
 1000|    138|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    138|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    138|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 9, False: 129]
  ------------------
 1002|    364|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 356, False: 8]
  ------------------
 1003|    356|        TopologySplitEventData event_data;
 1004|    356|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 0, False: 356]
  ------------------
 1005|      0|          return -1;
 1006|      0|        }
 1007|    356|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 1, False: 355]
  ------------------
 1008|      1|          return -1;
 1009|      1|        }
 1010|    355|        uint8_t edge_data;
 1011|    355|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 0, False: 355]
  ------------------
 1012|      0|          return -1;
 1013|      0|        }
 1014|    355|        event_data.source_edge = edge_data & 1;
 1015|    355|        topology_split_data_.push_back(event_data);
 1016|    355|      }
 1017|       |
 1018|      9|    } else
 1019|    129|#endif
 1020|    129|    {
 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|    129|      int last_source_symbol_id = 0;
 1024|    339|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 210, False: 129]
  ------------------
 1025|    210|        TopologySplitEventData event_data;
 1026|    210|        uint32_t delta;
 1027|    210|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 0, False: 210]
  ------------------
 1028|      0|          return -1;
 1029|      0|        }
 1030|    210|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|    210|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 0, False: 210]
  ------------------
 1032|      0|          return -1;
 1033|      0|        }
 1034|    210|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 0, False: 210]
  ------------------
 1035|      0|          return -1;
 1036|      0|        }
 1037|    210|        event_data.split_symbol_id =
 1038|    210|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|    210|        last_source_symbol_id = event_data.source_symbol_id;
 1040|    210|        topology_split_data_.push_back(event_data);
 1041|    210|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    129|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|    339|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 210, False: 129]
  ------------------
 1045|    210|        uint32_t edge_data;
 1046|    210|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    210|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 3, False: 207]
  ------------------
 1047|      3|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|    207|        } else {
 1049|    207|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|    207|        }
 1051|    210|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|    210|        event_data.source_edge = edge_data & 1;
 1053|    210|      }
 1054|    129|      decoder_buffer->EndBitDecoding();
 1055|    129|    }
 1056|    138|  }
 1057|    212|  uint32_t num_hole_events = 0;
 1058|    212|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|    212|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    212|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 17, False: 195]
  ------------------
 1060|     17|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 0, False: 17]
  ------------------
 1061|      0|      return -1;
 1062|      0|    }
 1063|    195|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    195|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 40, False: 155]
  ------------------
 1064|     40|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 0, False: 40]
  ------------------
 1065|      0|      return -1;
 1066|      0|    }
 1067|     40|  }
 1068|    212|#endif
 1069|    212|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 17, False: 195]
  ------------------
 1070|     17|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     17|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     17|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 6, False: 11]
  ------------------
 1072|  33.4k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 33.4k, False: 2]
  ------------------
 1073|  33.4k|        HoleEventData event_data;
 1074|  33.4k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 4, False: 33.4k]
  ------------------
 1075|      4|          return -1;
 1076|      4|        }
 1077|  33.4k|        hole_event_data_.push_back(event_data);
 1078|  33.4k|      }
 1079|       |
 1080|      6|    } else
 1081|     11|#endif
 1082|     11|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     11|      int last_symbol_id = 0;
 1085|  76.4k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 76.4k, False: 1]
  ------------------
 1086|  76.4k|        HoleEventData event_data;
 1087|  76.4k|        uint32_t delta;
 1088|  76.4k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 10, False: 76.4k]
  ------------------
 1089|     10|          return -1;
 1090|     10|        }
 1091|  76.4k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  76.4k|        last_symbol_id = event_data.symbol_id;
 1093|  76.4k|        hole_event_data_.push_back(event_data);
 1094|  76.4k|      }
 1095|     11|    }
 1096|     17|  }
 1097|    198|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|    212|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|     74|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|     74|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|     74|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|    296|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 222, False: 74]
  ------------------
 1109|    222|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|    222|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 158, False: 64]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|    316|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 158, False: 158]
  ------------------
 1114|    158|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|    158|      }
 1116|    158|      continue;
 1117|    158|    }
 1118|       |
 1119|    128|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 64, False: 64]
  ------------------
 1120|     64|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     64|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 0, False: 64]
  ------------------
 1122|      0|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|      0|      }
 1124|     64|    }
 1125|     64|  }
 1126|     74|  return true;
 1127|     74|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   324k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   324k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   324k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   324k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.29M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 974k, False: 324k]
  ------------------
 1139|   974k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   974k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 34.2k, False: 940k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   259k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 225k, False: 34.2k]
  ------------------
 1144|   225k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   225k|      }
 1146|  34.2k|      continue;
 1147|  34.2k|    }
 1148|   940k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   940k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 470k, False: 470k]
  ------------------
 1151|   470k|      continue;
 1152|   470k|    }
 1153|       |
 1154|  4.00M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 3.53M, False: 470k]
  ------------------
 1155|  3.53M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  3.53M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 3.20M, False: 336k]
  ------------------
 1157|  3.20M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  3.20M|      }
 1159|  3.53M|    }
 1160|   470k|  }
 1161|   324k|  return true;
 1162|   324k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|    122|    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|    122|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    122|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 0, False: 122]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|      0|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 0, False: 0]
  ------------------
 1176|      0|      Mesh::Face face;
 1177|      0|      const CornerIndex start_corner(3 * f.value());
 1178|      0|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 0, False: 0]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|      0|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|      0|        face[c] = vert_id;
 1182|      0|      }
 1183|      0|      decoder_->mesh()->SetFace(f, face);
 1184|      0|    }
 1185|      0|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|      0|    return true;
 1187|      0|  }
 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|    122|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    122|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   194k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 194k, False: 121]
  ------------------
 1197|   194k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   194k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 13.6k, False: 180k]
  ------------------
 1199|  13.6k|      continue;  // Isolated vertex.
 1200|  13.6k|    }
 1201|   180k|    CornerIndex deduplication_first_corner = c;
 1202|   180k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 32.6k, False: 148k]
  ------------------
 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|  32.6k|      deduplication_first_corner = c;
 1206|   148k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   154k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 153k, False: 570]
  ------------------
 1210|   153k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 2.64k, False: 151k]
  ------------------
 1211|  2.64k|          continue;  // No seam for this attribute, ignore it.
 1212|  2.64k|        }
 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|   151k|        const VertexIndex vert_id =
 1217|   151k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   151k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   151k|        bool seam_found = false;
 1220|   156k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 152k, False: 3.73k]
  ------------------
 1221|   152k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 1, False: 152k]
  ------------------
 1222|      1|            return false;
 1223|      1|          }
 1224|   152k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 147k, False: 5.22k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   147k|            deduplication_first_corner = act_c;
 1227|   147k|            seam_found = true;
 1228|   147k|            break;
 1229|   147k|          }
 1230|  5.22k|          act_c = corner_table_->SwingRight(act_c);
 1231|  5.22k|        }
 1232|   151k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 147k, False: 3.73k]
  ------------------
 1233|   147k|          break;  // No reason to process other attributes if we found a seam.
 1234|   147k|        }
 1235|   151k|      }
 1236|   148k|    }
 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|   180k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   180k|    corner_to_point_map[c.value()] =
 1246|   180k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   180k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   180k|    CornerIndex prev_c = c;
 1250|   180k|    c = corner_table_->SwingRight(c);
 1251|  1.00M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 967k, False: 32.8k]
  |  Branch (1251:40): [True: 819k, False: 147k]
  ------------------
 1252|   819k|      bool attribute_seam = false;
 1253|   841k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 839k, False: 2.24k]
  ------------------
 1254|   839k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 817k, False: 21.6k]
  ------------------
 1255|   839k|            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|   817k|          attribute_seam = true;
 1259|   817k|          break;
 1260|   817k|        }
 1261|   839k|      }
 1262|   819k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 817k, False: 2.24k]
  ------------------
 1263|   817k|        corner_to_point_map[c.value()] =
 1264|   817k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   817k|        point_to_corner_map.push_back(c.value());
 1266|   817k|      } else {
 1267|  2.24k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  2.24k|      }
 1269|   819k|      prev_c = c;
 1270|   819k|      c = corner_table_->SwingRight(c);
 1271|   819k|    }
 1272|   180k|  }
 1273|       |  // Add faces.
 1274|   312k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 312k, False: 121]
  ------------------
 1275|   312k|    Mesh::Face face;
 1276|  1.25M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 937k, False: 312k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   937k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   937k|    }
 1280|   312k|    decoder_->mesh()->SetFace(f, face);
 1281|   312k|  }
 1282|    121|  decoder_->point_cloud()->set_num_points(
 1283|    121|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    121|  return true;
 1285|    122|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|    178|    : decoder_(nullptr),
   49|    178|      last_symbol_id_(-1),
   50|    178|      last_vert_id_(-1),
   51|    178|      last_face_id_(-1),
   52|    178|      num_new_vertices_(0),
   53|    178|      num_encoded_vertices_(0),
   54|    178|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|    178|    MeshEdgebreakerDecoder *decoder) {
   59|    178|  decoder_ = decoder;
   60|    178|  return true;
   61|    178|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|    282|    int att_id) const {
   67|    447|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 301, False: 146]
  ------------------
   68|    301|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    301|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 165, False: 136]
  |  Branch (69:27): [True: 0, False: 136]
  ------------------
   70|    165|      continue;
   71|    165|    }
   72|    136|    const AttributesDecoderInterface *const dec =
   73|    136|        decoder_->attributes_decoder(decoder_id);
   74|    760|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 760, False: 0]
  ------------------
   75|    760|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 136, False: 624]
  ------------------
   76|    136|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 66, False: 70]
  ------------------
   77|     66|          return &attribute_data_[i].connectivity_data;
   78|     66|        }
   79|     70|        return nullptr;
   80|    136|      }
   81|    760|    }
   82|    136|  }
   83|    146|  return nullptr;
   84|    282|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|    282|    int att_id) const {
   90|    447|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 301, False: 146]
  ------------------
   91|    301|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    301|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 165, False: 136]
  |  Branch (92:27): [True: 0, False: 136]
  ------------------
   93|    165|      continue;
   94|    165|    }
   95|    136|    const AttributesDecoderInterface *const dec =
   96|    136|        decoder_->attributes_decoder(decoder_id);
   97|    760|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 760, False: 0]
  ------------------
   98|    760|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 136, False: 624]
  ------------------
   99|    136|        return &attribute_data_[i].encoding_data;
  100|    136|      }
  101|    760|    }
  102|    136|  }
  103|    146|  return &pos_encoding_data_;
  104|    282|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  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: 0, False: 144]
  ------------------
  133|      0|    return false;
  134|      0|  }
  135|    144|  uint8_t decoder_type;
  136|    144|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 0, False: 144]
  ------------------
  137|      0|    return false;
  138|      0|  }
  139|       |
  140|    144|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 82, False: 62]
  ------------------
  141|     82|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 0, False: 82]
  ------------------
  142|      0|      return false;  // Unexpected attribute data.
  143|      0|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|     82|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 0, False: 82]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|       |
  151|     82|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|     82|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|     62|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 0, False: 62]
  ------------------
  155|      0|      return false;  // Some other decoder is already using the data. Error.
  156|      0|    }
  157|     62|    pos_data_decoder_id_ = att_decoder_id;
  158|     62|  }
  159|       |
  160|    144|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    144|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    144|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 144, False: 0]
  ------------------
  162|    144|    uint8_t traversal_method_encoded;
  163|    144|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 0, False: 144]
  ------------------
  164|      0|      return false;
  165|      0|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    144|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 0, False: 144]
  ------------------
  168|      0|      return false;
  169|      0|    }
  170|    144|    traversal_method =
  171|    144|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    144|  }
  173|       |
  174|    144|  const Mesh *mesh = decoder_->mesh();
  175|    144|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    144|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 109, False: 35]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    109|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    109|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 62, False: 47]
  ------------------
  182|     62|      encoding_data = &pos_encoding_data_;
  183|     62|    } else {
  184|     47|      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|     47|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     47|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    109|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 4, False: 105]
  ------------------
  191|      4|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|      4|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|      4|          AttTraverser;
  194|      4|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    105|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 105, False: 0]
  ------------------
  196|    105|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    105|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    105|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    105|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    109|  } else {
  203|     35|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 0, False: 35]
  ------------------
  204|      0|      return false;  // Unsupported method.
  205|      0|    }
  206|     35|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 0, False: 35]
  ------------------
  207|      0|      return false;  // Attribute data must be specified.
  208|      0|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     35|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     35|        AttObserver;
  214|     35|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     35|        AttTraverser;
  216|       |
  217|     35|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     35|        &attribute_data_[att_data_id].encoding_data;
  219|     35|    const MeshAttributeCornerTable *const corner_table =
  220|     35|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     35|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     35|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     35|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     35|                             encoding_data);
  227|       |
  228|     35|    AttTraverser att_traverser;
  229|     35|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     35|    traversal_sequencer->SetTraverser(att_traverser);
  232|     35|    sequencer = std::move(traversal_sequencer);
  233|     35|  }
  234|       |
  235|    144|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 144]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|    144|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|    144|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|    144|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|    144|                                        std::move(att_controller));
  244|    144|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|    178|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|    178|  num_new_vertices_ = 0;
  249|    178|  new_to_parent_vertex_map_.clear();
  250|    178|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|    178|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    178|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 31, False: 147]
  ------------------
  252|     31|    uint32_t num_new_verts;
  253|     31|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     31|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 30, False: 1]
  ------------------
  254|     30|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 30]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|     30|    } else {
  258|      1|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 1]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|      1|    }
  262|     31|    num_new_vertices_ = num_new_verts;
  263|     31|  }
  264|    178|#endif
  265|       |
  266|    178|  uint32_t num_encoded_vertices;
  267|    178|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|    178|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    178|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 30, False: 148]
  ------------------
  269|     30|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 30]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|     30|  } else
  274|    148|#endif
  275|    148|  {
  276|    148|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 148]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|    148|  }
  280|    178|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|    178|  uint32_t num_faces;
  283|    178|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|    178|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    178|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 30, False: 148]
  ------------------
  285|     30|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 30]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|     30|  } else
  290|    148|#endif
  291|    148|  {
  292|    148|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 148]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|    148|  }
  296|    178|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 0, False: 178]
  ------------------
  297|      0|    return false;  // Draco cannot handle this many faces.
  298|      0|  }
  299|       |
  300|    178|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 2, False: 176]
  ------------------
  301|      2|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      2|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|    176|  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|    176|  const uint64_t num_encoded_vertices_64 =
  311|    176|      static_cast<uint64_t>(num_encoded_vertices_);
  312|    176|  const uint64_t max_num_vertex_edges =
  313|    176|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|    176|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 0, False: 176]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      0|    return false;
  317|      0|  }
  318|       |
  319|    176|  uint8_t num_attribute_data;
  320|    176|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 176]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|    176|  uint32_t num_encoded_symbols;
  325|    176|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|    176|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    176|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 28, False: 148]
  ------------------
  327|     28|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 28]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|     28|  } else
  332|    148|#endif
  333|    148|  {
  334|    148|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 148]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|    148|  }
  338|       |
  339|    176|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 0, False: 176]
  ------------------
  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|      0|    return false;
  344|      0|  }
  345|    176|  const uint32_t max_encoded_faces =
  346|    176|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|    176|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 1, False: 175]
  ------------------
  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|      1|    return false;
  352|      1|  }
  353|       |
  354|    175|  uint32_t num_encoded_split_symbols;
  355|    175|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|    175|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    175|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 27, False: 148]
  ------------------
  357|     27|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 27]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|     27|  } else
  362|    148|#endif
  363|    148|  {
  364|    148|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 148]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|    148|  }
  368|       |
  369|    175|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 0, False: 175]
  ------------------
  370|      0|    return false;  // Split symbols are a sub-set of all symbols.
  371|      0|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|    175|  vertex_traversal_length_.clear();
  375|    175|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|    175|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 175]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|    175|  processed_corner_ids_.clear();
  380|    175|  processed_corner_ids_.reserve(num_faces);
  381|    175|  processed_connectivity_corners_.clear();
  382|    175|  processed_connectivity_corners_.reserve(num_faces);
  383|    175|  topology_split_data_.clear();
  384|    175|  hole_event_data_.clear();
  385|    175|  init_face_configurations_.clear();
  386|    175|  init_corners_.clear();
  387|       |
  388|    175|  last_symbol_id_ = -1;
  389|    175|  last_face_id_ = -1;
  390|    175|  last_vert_id_ = -1;
  391|       |
  392|    175|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|    175|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|    175|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 175]
  ------------------
  397|    175|          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|    175|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|    175|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|    175|  int32_t topology_split_decoded_bytes = -1;
  410|    175|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    175|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 28, False: 147]
  ------------------
  411|     28|    uint32_t encoded_connectivity_size;
  412|     28|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     28|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 27, False: 1]
  ------------------
  413|     27|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 27]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|     27|    } else {
  417|      1|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 1]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|      1|    }
  421|     28|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 0, False: 28]
  ------------------
  422|     28|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 0, False: 28]
  ------------------
  423|      0|      return false;
  424|      0|    }
  425|     28|    DecoderBuffer event_buffer;
  426|     28|    event_buffer.Init(
  427|     28|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|     28|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|     28|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|     28|    topology_split_decoded_bytes =
  432|     28|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|     28|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 26, False: 2]
  ------------------
  434|     26|      return false;
  435|     26|    }
  436|       |
  437|     28|  } else
  438|    147|#endif
  439|    147|  {
  440|    147|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 0, False: 147]
  ------------------
  441|      0|      return false;
  442|      0|    }
  443|    147|  }
  444|       |
  445|    149|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|    149|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|    149|                                           num_encoded_split_symbols);
  449|    149|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|    149|  DecoderBuffer traversal_end_buffer;
  452|    149|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 4, False: 145]
  ------------------
  453|      4|    return false;
  454|      4|  }
  455|       |
  456|    145|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|    145|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 1, False: 144]
  ------------------
  458|      1|    return false;
  459|      1|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    144|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    144|                           traversal_end_buffer.remaining_size(),
  464|    144|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    144|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    144|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    144|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 0, False: 144]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      0|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      0|  }
  471|    144|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    144|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 144, False: 0]
  ------------------
  475|    144|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    144|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    144|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 0, False: 144]
  ------------------
  477|      0|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 0, False: 0]
  ------------------
  478|      0|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 0]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|      0|      }
  482|       |
  483|      0|    } else
  484|    144|#endif
  485|    144|    {
  486|   709k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 709k, False: 144]
  ------------------
  487|   709k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 709k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   709k|      }
  491|    144|    }
  492|    144|  }
  493|    144|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    319|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 175, False: 144]
  ------------------
  498|    175|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  1.04M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 1.04M, False: 175]
  ------------------
  501|  1.04M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  1.04M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    175|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 175]
  ------------------
  505|    175|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    175|  }
  509|       |
  510|    144|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    319|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 175, False: 144]
  ------------------
  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|    175|    int32_t att_connectivity_verts =
  517|    175|        attribute_data_[i].connectivity_data.num_vertices();
  518|    175|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 3, False: 172]
  ------------------
  519|      3|      att_connectivity_verts = corner_table_->num_vertices();
  520|      3|    }
  521|    175|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    175|  }
  523|    144|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 0, False: 144]
  ------------------
  524|      0|    return false;
  525|      0|  }
  526|    144|  return true;
  527|    144|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|     20|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     20|  return true;
  532|     20|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|    145|    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|    145|  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|    145|  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|    145|  std::vector<VertexIndex> invalid_vertices;
  558|    145|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|    145|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|    145|  int num_faces = 0;
  562|  2.45M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 2.45M, False: 145]
  ------------------
  563|  2.45M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  2.45M|    bool check_topology_split = false;
  566|  2.45M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  2.45M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 1.22M, False: 1.23M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  1.22M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 1.22M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  1.22M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  1.22M|      const VertexIndex vertex_x =
  593|  1.22M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  1.22M|      const CornerIndex corner_b =
  595|  1.22M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  1.22M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 0, False: 1.22M]
  ------------------
  598|       |        // All matched corners must be different.
  599|      0|        return -1;
  600|      0|      }
  601|  1.22M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 1.22M]
  |  Branch (601:11): [True: 0, False: 1.22M]
  ------------------
  602|  1.22M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 1.22M]
  ------------------
  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|  1.22M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  1.22M|      SetOppositeCorners(corner_a, corner + 1);
  612|  1.22M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  1.22M|      const VertexIndex vert_a_prev =
  616|  1.22M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  1.22M|      const VertexIndex vert_b_next =
  618|  1.22M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  1.22M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 1.22M]
  |  Branch (619:38): [True: 0, False: 1.22M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  1.22M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  1.22M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  1.22M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  1.22M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  1.22M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  1.22M|      active_corner_stack.back() = corner;
  631|  1.23M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 1.23M, False: 1.16k]
  |  Branch (631:40): [True: 342, False: 825]
  ------------------
  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.23M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 1.23M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  1.23M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  1.23M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 1.23M]
  ------------------
  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.23M|      const CornerIndex corner(3 * face.value());
  658|  1.23M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  1.23M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 1.23M, False: 342]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  1.23M|        opp_corner = corner + 2;
  662|  1.23M|        corner_l = corner + 1;
  663|  1.23M|        corner_r = corner;
  664|  1.23M|      } else {
  665|       |        // "l" is the new first corner.
  666|    342|        opp_corner = corner + 1;
  667|    342|        corner_l = corner;
  668|    342|        corner_r = corner + 2;
  669|    342|      }
  670|  1.23M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  1.23M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  1.23M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 0, False: 1.23M]
  ------------------
  675|      0|        return -1;  // Unexpected number of decoded vertices.
  676|      0|      }
  677|       |
  678|  1.23M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  1.23M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  1.23M|      const VertexIndex vertex_r =
  682|  1.23M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  1.23M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  1.23M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  1.23M|      corner_table_->MapCornerToVertex(
  688|  1.23M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  1.23M|      active_corner_stack.back() = corner;
  690|  1.23M|      check_topology_split = true;
  691|  1.23M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 184, False: 641]
  ------------------
  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|    184|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 184]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|    184|      const CornerIndex corner_b = active_corner_stack.back();
  706|    184|      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|    184|      const auto it = topology_split_active_corners.find(symbol_id);
  711|    184|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 0, False: 184]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|      0|        active_corner_stack.push_back(it->second);
  714|      0|      }
  715|    184|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 0, False: 184]
  ------------------
  716|      0|        return -1;
  717|      0|      }
  718|    184|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|    184|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 184]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|    184|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 0, False: 184]
  |  Branch (724:11): [True: 0, False: 184]
  ------------------
  725|    184|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 184]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      0|        return -1;
  729|      0|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|    184|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|    184|      SetOppositeCorners(corner_a, corner + 2);
  735|    184|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|    184|      const VertexIndex vertex_p =
  739|    184|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|    184|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|    184|      corner_table_->MapCornerToVertex(
  742|    184|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|    184|      const VertexIndex vert_b_prev =
  744|    184|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|    184|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|    184|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|    184|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|    184|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|    184|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|    184|      corner_table_->SetLeftMostCorner(vertex_p,
  752|    184|                                       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|    184|      const CornerIndex first_corner = corner_n;
  757|    764|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 580, False: 184]
  ------------------
  758|    580|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|    580|        corner_n = corner_table_->SwingLeft(corner_n);
  760|    580|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 0, False: 580]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      0|          return -1;
  764|      0|        }
  765|    580|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|    184|      corner_table_->MakeVertexIsolated(vertex_n);
  769|    184|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 0, False: 184]
  ------------------
  770|      0|        invalid_vertices.push_back(vertex_n);
  771|      0|      }
  772|    184|      active_corner_stack.back() = corner;
  773|    641|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 641, False: 0]
  ------------------
  774|    641|      const CornerIndex corner(3 * face.value());
  775|    641|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|    641|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|    641|      corner_table_->MapCornerToVertex(corner + 1,
  779|    641|                                       corner_table_->AddNewVertex());
  780|    641|      corner_table_->MapCornerToVertex(corner + 2,
  781|    641|                                       corner_table_->AddNewVertex());
  782|       |
  783|    641|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 0, False: 641]
  ------------------
  784|      0|        return -1;  // Unexpected number of decoded vertices.
  785|      0|      }
  786|       |
  787|    641|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|    641|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|    641|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|    641|      active_corner_stack.push_back(corner);
  792|    641|      check_topology_split = true;
  793|    641|    } 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|  2.45M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  2.45M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 1.23M, False: 1.22M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  1.23M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  1.23M|      EdgeFaceName split_edge;
  812|  1.23M|      int encoder_split_symbol_id;
  813|  1.23M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 62, False: 1.23M]
  ------------------
  814|  1.23M|                             &encoder_split_symbol_id)) {
  815|     62|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 0, False: 62]
  ------------------
  816|      0|          return -1;  // Wrong split symbol id.
  817|      0|        }
  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|     62|        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|     62|        CornerIndex new_active_corner;
  831|     62|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 14, False: 48]
  ------------------
  832|     14|          new_active_corner = corner_table_->Next(act_top_corner);
  833|     48|        } else {
  834|     48|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|     48|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|     62|        const int decoder_split_symbol_id =
  839|     62|            num_symbols - encoder_split_symbol_id - 1;
  840|     62|        topology_split_active_corners[decoder_split_symbol_id] =
  841|     62|            new_active_corner;
  842|     62|      }
  843|  1.23M|    }
  844|  2.45M|  }
  845|    145|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 145]
  ------------------
  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|    403|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 259, False: 144]
  ------------------
  850|    259|    const CornerIndex corner = active_corner_stack.back();
  851|    259|    active_corner_stack.pop_back();
  852|    259|    const bool interior_face =
  853|    259|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|    259|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 180, False: 79]
  ------------------
  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|    180|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 0, False: 180]
  ------------------
  877|      0|        return -1;  // More faces than expected added to the mesh.
  878|      0|      }
  879|       |
  880|    180|      const CornerIndex corner_a = corner;
  881|    180|      const VertexIndex vert_n =
  882|    180|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|    180|      const CornerIndex corner_b =
  884|    180|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|    180|      const VertexIndex vert_x =
  887|    180|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|    180|      const CornerIndex corner_c =
  889|    180|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|    180|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 0, False: 180]
  |  Branch (891:33): [True: 1, False: 179]
  |  Branch (891:55): [True: 0, False: 179]
  ------------------
  892|       |        // All matched corners must be different.
  893|      1|        return -1;
  894|      1|      }
  895|    179|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 179]
  |  Branch (895:11): [True: 0, False: 179]
  ------------------
  896|    179|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 179]
  ------------------
  897|    179|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 179]
  ------------------
  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|    179|      const VertexIndex vert_p =
  904|    179|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|    179|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|    179|      const CornerIndex new_corner(3 * face.value());
  909|    179|      SetOppositeCorners(new_corner, corner);
  910|    179|      SetOppositeCorners(new_corner + 1, corner_b);
  911|    179|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|    179|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|    179|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|    179|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|    716|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 537, False: 179]
  ------------------
  920|    537|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|    537|      }
  922|       |
  923|    179|      init_face_configurations_.push_back(true);
  924|    179|      init_corners_.push_back(new_corner);
  925|    179|    } 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|     79|      init_face_configurations_.push_back(false);
  930|     79|      init_corners_.push_back(corner);
  931|     79|    }
  932|    259|  }
  933|    144|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 0, False: 144]
  ------------------
  934|      0|    return -1;  // Unexpected number of decoded faces.
  935|      0|  }
  936|       |
  937|    144|  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|    144|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 0, False: 144]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|      0|    VertexIndex src_vert(num_vertices - 1);
  943|      0|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 0, False: 0]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|      0|      src_vert = VertexIndex(--num_vertices - 1);
  946|      0|    }
  947|      0|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 0, False: 0]
  ------------------
  948|      0|      continue;  // No need to swap anything.
  949|      0|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|      0|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|      0|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 0, False: 0]
  ------------------
  954|      0|      const CornerIndex cid = vcit.Corner();
  955|      0|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 0, False: 0]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      0|        return -1;
  959|      0|      }
  960|      0|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|      0|    }
  962|      0|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|      0|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|      0|    corner_table_->MakeVertexIsolated(src_vert);
  967|      0|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|      0|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|      0|    num_vertices--;
  972|      0|  }
  973|    144|  return num_vertices;
  974|    144|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|    175|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|    175|  uint32_t num_topology_splits;
  982|    175|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|    175|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    175|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 27, False: 148]
  ------------------
  984|     27|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 27]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|     27|  } else
  989|    148|#endif
  990|    148|  {
  991|    148|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 148]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|    148|  }
  995|    175|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 57, False: 118]
  ------------------
  996|     57|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 2, False: 55]
  ------------------
  997|     57|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|      2|      return -1;
  999|      2|    }
 1000|     55|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|     55|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     55|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 23, False: 32]
  ------------------
 1002|  86.5k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 86.5k, False: 7]
  ------------------
 1003|  86.5k|        TopologySplitEventData event_data;
 1004|  86.5k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 8, False: 86.5k]
  ------------------
 1005|      8|          return -1;
 1006|      8|        }
 1007|  86.5k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 6, False: 86.5k]
  ------------------
 1008|      6|          return -1;
 1009|      6|        }
 1010|  86.5k|        uint8_t edge_data;
 1011|  86.5k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 2, False: 86.5k]
  ------------------
 1012|      2|          return -1;
 1013|      2|        }
 1014|  86.5k|        event_data.source_edge = edge_data & 1;
 1015|  86.5k|        topology_split_data_.push_back(event_data);
 1016|  86.5k|      }
 1017|       |
 1018|     23|    } else
 1019|     32|#endif
 1020|     32|    {
 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|     32|      int last_source_symbol_id = 0;
 1024|    185|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 153, False: 32]
  ------------------
 1025|    153|        TopologySplitEventData event_data;
 1026|    153|        uint32_t delta;
 1027|    153|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 0, False: 153]
  ------------------
 1028|      0|          return -1;
 1029|      0|        }
 1030|    153|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|    153|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 0, False: 153]
  ------------------
 1032|      0|          return -1;
 1033|      0|        }
 1034|    153|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 0, False: 153]
  ------------------
 1035|      0|          return -1;
 1036|      0|        }
 1037|    153|        event_data.split_symbol_id =
 1038|    153|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|    153|        last_source_symbol_id = event_data.source_symbol_id;
 1040|    153|        topology_split_data_.push_back(event_data);
 1041|    153|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|     32|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|    185|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 153, False: 32]
  ------------------
 1045|    153|        uint32_t edge_data;
 1046|    153|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    153|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 0, False: 153]
  ------------------
 1047|      0|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|    153|        } else {
 1049|    153|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|    153|        }
 1051|    153|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|    153|        event_data.source_edge = edge_data & 1;
 1053|    153|      }
 1054|     32|      decoder_buffer->EndBitDecoding();
 1055|     32|    }
 1056|     55|  }
 1057|    157|  uint32_t num_hole_events = 0;
 1058|    157|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|    157|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    157|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 10, False: 147]
  ------------------
 1060|     10|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 0, False: 10]
  ------------------
 1061|      0|      return -1;
 1062|      0|    }
 1063|    147|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    147|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 0, False: 147]
  ------------------
 1064|      0|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 0, False: 0]
  ------------------
 1065|      0|      return -1;
 1066|      0|    }
 1067|      0|  }
 1068|    157|#endif
 1069|    157|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 9, False: 148]
  ------------------
 1070|      9|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|      9|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|      9|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 9, False: 0]
  ------------------
 1072|   119k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 119k, False: 1]
  ------------------
 1073|   119k|        HoleEventData event_data;
 1074|   119k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 8, False: 119k]
  ------------------
 1075|      8|          return -1;
 1076|      8|        }
 1077|   119k|        hole_event_data_.push_back(event_data);
 1078|   119k|      }
 1079|       |
 1080|      9|    } else
 1081|      0|#endif
 1082|      0|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|      0|      int last_symbol_id = 0;
 1085|      0|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 0, False: 0]
  ------------------
 1086|      0|        HoleEventData event_data;
 1087|      0|        uint32_t delta;
 1088|      0|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 0, False: 0]
  ------------------
 1089|      0|          return -1;
 1090|      0|        }
 1091|      0|        event_data.symbol_id = delta + last_symbol_id;
 1092|      0|        last_symbol_id = event_data.symbol_id;
 1093|      0|        hole_event_data_.push_back(event_data);
 1094|      0|      }
 1095|      0|    }
 1096|      9|  }
 1097|    149|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|    157|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   709k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   709k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   709k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   709k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  2.83M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 2.12M, False: 709k]
  ------------------
 1139|  2.12M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  2.12M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 1.82k, False: 2.12M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|  3.90k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 2.07k, False: 1.82k]
  ------------------
 1144|  2.07k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|  2.07k|      }
 1146|  1.82k|      continue;
 1147|  1.82k|    }
 1148|  2.12M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  2.12M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 1.06M, False: 1.06M]
  ------------------
 1151|  1.06M|      continue;
 1152|  1.06M|    }
 1153|       |
 1154|  2.13M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 1.06M, False: 1.06M]
  ------------------
 1155|  1.06M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  1.06M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 1.04M, False: 20.2k]
  ------------------
 1157|  1.04M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  1.04M|      }
 1159|  1.06M|    }
 1160|  1.06M|  }
 1161|   709k|  return true;
 1162|   709k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|    144|    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|    144|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    144|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 0, False: 144]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|      0|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 0, False: 0]
  ------------------
 1176|      0|      Mesh::Face face;
 1177|      0|      const CornerIndex start_corner(3 * f.value());
 1178|      0|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 0, False: 0]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|      0|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|      0|        face[c] = vert_id;
 1182|      0|      }
 1183|      0|      decoder_->mesh()->SetFace(f, face);
 1184|      0|    }
 1185|      0|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|      0|    return true;
 1187|      0|  }
 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|    144|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    144|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   356k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 356k, False: 144]
  ------------------
 1197|   356k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   356k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 157, False: 355k]
  ------------------
 1199|    157|      continue;  // Isolated vertex.
 1200|    157|    }
 1201|   355k|    CornerIndex deduplication_first_corner = c;
 1202|   355k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 1.82k, False: 354k]
  ------------------
 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|  1.82k|      deduplication_first_corner = c;
 1206|   354k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   359k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 354k, False: 5.67k]
  ------------------
 1210|   354k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 5.34k, False: 348k]
  ------------------
 1211|  5.34k|          continue;  // No seam for this attribute, ignore it.
 1212|  5.34k|        }
 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|   348k|        const VertexIndex vert_id =
 1217|   348k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   348k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   348k|        bool seam_found = false;
 1220|   352k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 352k, False: 393]
  ------------------
 1221|   352k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 0, False: 352k]
  ------------------
 1222|      0|            return false;
 1223|      0|          }
 1224|   352k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 348k, False: 4.13k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   348k|            deduplication_first_corner = act_c;
 1227|   348k|            seam_found = true;
 1228|   348k|            break;
 1229|   348k|          }
 1230|  4.13k|          act_c = corner_table_->SwingRight(act_c);
 1231|  4.13k|        }
 1232|   348k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 348k, False: 393]
  ------------------
 1233|   348k|          break;  // No reason to process other attributes if we found a seam.
 1234|   348k|        }
 1235|   348k|      }
 1236|   354k|    }
 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|   355k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   355k|    corner_to_point_map[c.value()] =
 1246|   355k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   355k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   355k|    CornerIndex prev_c = c;
 1250|   355k|    c = corner_table_->SwingRight(c);
 1251|  2.12M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 2.12M, False: 1.91k]
  |  Branch (1251:40): [True: 1.77M, False: 354k]
  ------------------
 1252|  1.77M|      bool attribute_seam = false;
 1253|  1.80M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 1.77M, False: 31.4k]
  ------------------
 1254|  1.77M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 1.74M, False: 32.1k]
  ------------------
 1255|  1.77M|            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|  1.74M|          attribute_seam = true;
 1259|  1.74M|          break;
 1260|  1.74M|        }
 1261|  1.77M|      }
 1262|  1.77M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 1.74M, False: 31.4k]
  ------------------
 1263|  1.74M|        corner_to_point_map[c.value()] =
 1264|  1.74M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  1.74M|        point_to_corner_map.push_back(c.value());
 1266|  1.74M|      } else {
 1267|  31.4k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  31.4k|      }
 1269|  1.77M|      prev_c = c;
 1270|  1.77M|      c = corner_table_->SwingRight(c);
 1271|  1.77M|    }
 1272|   355k|  }
 1273|       |  // Add faces.
 1274|   709k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 709k, False: 144]
  ------------------
 1275|   709k|    Mesh::Face face;
 1276|  2.83M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 2.12M, False: 709k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  2.12M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  2.12M|    }
 1280|   709k|    decoder_->mesh()->SetFace(f, face);
 1281|   709k|  }
 1282|    144|  decoder_->point_cloud()->set_num_points(
 1283|    144|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    144|  return true;
 1285|    144|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|    118|    : decoder_(nullptr),
   49|    118|      last_symbol_id_(-1),
   50|    118|      last_vert_id_(-1),
   51|    118|      last_face_id_(-1),
   52|    118|      num_new_vertices_(0),
   53|    118|      num_encoded_vertices_(0),
   54|    118|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|    118|    MeshEdgebreakerDecoder *decoder) {
   59|    118|  decoder_ = decoder;
   60|    118|  return true;
   61|    118|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|      4|    int att_id) const {
   67|      8|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 6, False: 2]
  ------------------
   68|      6|    const int decoder_id = attribute_data_[i].decoder_id;
   69|      6|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 4, False: 2]
  |  Branch (69:27): [True: 0, False: 2]
  ------------------
   70|      4|      continue;
   71|      4|    }
   72|      2|    const AttributesDecoderInterface *const dec =
   73|      2|        decoder_->attributes_decoder(decoder_id);
   74|     18|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 18, False: 0]
  ------------------
   75|     18|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 2, False: 16]
  ------------------
   76|      2|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 2, False: 0]
  ------------------
   77|      2|          return &attribute_data_[i].connectivity_data;
   78|      2|        }
   79|      0|        return nullptr;
   80|      2|      }
   81|     18|    }
   82|      2|  }
   83|      2|  return nullptr;
   84|      4|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|      4|    int att_id) const {
   90|      8|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 6, False: 2]
  ------------------
   91|      6|    const int decoder_id = attribute_data_[i].decoder_id;
   92|      6|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 4, False: 2]
  |  Branch (92:27): [True: 0, False: 2]
  ------------------
   93|      4|      continue;
   94|      4|    }
   95|      2|    const AttributesDecoderInterface *const dec =
   96|      2|        decoder_->attributes_decoder(decoder_id);
   97|     18|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 18, False: 0]
  ------------------
   98|     18|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 2, False: 16]
  ------------------
   99|      2|        return &attribute_data_[i].encoding_data;
  100|      2|      }
  101|     18|    }
  102|      2|  }
  103|      2|  return &pos_encoding_data_;
  104|      4|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|     12|    int32_t att_decoder_id) {
  131|     12|  int8_t att_data_id;
  132|     12|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 0, False: 12]
  ------------------
  133|      0|    return false;
  134|      0|  }
  135|     12|  uint8_t decoder_type;
  136|     12|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 0, False: 12]
  ------------------
  137|      0|    return false;
  138|      0|  }
  139|       |
  140|     12|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 11, False: 1]
  ------------------
  141|     11|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 0, False: 11]
  ------------------
  142|      0|      return false;  // Unexpected attribute data.
  143|      0|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|     11|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 0, False: 11]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|       |
  151|     11|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|     11|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|      1|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 0, False: 1]
  ------------------
  155|      0|      return false;  // Some other decoder is already using the data. Error.
  156|      0|    }
  157|      1|    pos_data_decoder_id_ = att_decoder_id;
  158|      1|  }
  159|       |
  160|     12|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|     12|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     12|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 12, False: 0]
  ------------------
  162|     12|    uint8_t traversal_method_encoded;
  163|     12|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 0, False: 12]
  ------------------
  164|      0|      return false;
  165|      0|    }
  166|       |    // Check that decoded traversal method is valid.
  167|     12|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 0, False: 12]
  ------------------
  168|      0|      return false;
  169|      0|    }
  170|     12|    traversal_method =
  171|     12|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|     12|  }
  173|       |
  174|     12|  const Mesh *mesh = decoder_->mesh();
  175|     12|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|     12|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1, False: 11]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|      1|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|      1|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 1, False: 0]
  ------------------
  182|      1|      encoding_data = &pos_encoding_data_;
  183|      1|    } else {
  184|      0|      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|      0|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|      0|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|      1|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 1, False: 0]
  ------------------
  191|      1|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|      1|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|      1|          AttTraverser;
  194|      1|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|      1|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 0, False: 0]
  ------------------
  196|      0|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|      0|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|      0|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|      0|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|     11|  } else {
  203|     11|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 0, False: 11]
  ------------------
  204|      0|      return false;  // Unsupported method.
  205|      0|    }
  206|     11|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 0, False: 11]
  ------------------
  207|      0|      return false;  // Attribute data must be specified.
  208|      0|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     11|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     11|        AttObserver;
  214|     11|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     11|        AttTraverser;
  216|       |
  217|     11|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     11|        &attribute_data_[att_data_id].encoding_data;
  219|     11|    const MeshAttributeCornerTable *const corner_table =
  220|     11|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     11|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     11|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     11|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     11|                             encoding_data);
  227|       |
  228|     11|    AttTraverser att_traverser;
  229|     11|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     11|    traversal_sequencer->SetTraverser(att_traverser);
  232|     11|    sequencer = std::move(traversal_sequencer);
  233|     11|  }
  234|       |
  235|     12|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 12]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|     12|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|     12|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|     12|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|     12|                                        std::move(att_controller));
  244|     12|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|    118|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|    118|  num_new_vertices_ = 0;
  249|    118|  new_to_parent_vertex_map_.clear();
  250|    118|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|    118|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    118|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 26, False: 92]
  ------------------
  252|     26|    uint32_t num_new_verts;
  253|     26|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     26|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 25, False: 1]
  ------------------
  254|     25|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 25]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|     25|    } else {
  258|      1|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 1]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|      1|    }
  262|     26|    num_new_vertices_ = num_new_verts;
  263|     26|  }
  264|    118|#endif
  265|       |
  266|    118|  uint32_t num_encoded_vertices;
  267|    118|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|    118|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    118|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 25, False: 93]
  ------------------
  269|     25|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 25]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|     25|  } else
  274|     93|#endif
  275|     93|  {
  276|     93|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 93]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|     93|  }
  280|    118|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|    118|  uint32_t num_faces;
  283|    118|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|    118|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    118|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 25, False: 93]
  ------------------
  285|     25|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 25]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|     25|  } else
  290|     93|#endif
  291|     93|  {
  292|     93|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 93]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|     93|  }
  296|    118|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 0, False: 118]
  ------------------
  297|      0|    return false;  // Draco cannot handle this many faces.
  298|      0|  }
  299|       |
  300|    118|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 0, False: 118]
  ------------------
  301|      0|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      0|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|    118|  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|    118|  const uint64_t num_encoded_vertices_64 =
  311|    118|      static_cast<uint64_t>(num_encoded_vertices_);
  312|    118|  const uint64_t max_num_vertex_edges =
  313|    118|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|    118|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 0, False: 118]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      0|    return false;
  317|      0|  }
  318|       |
  319|    118|  uint8_t num_attribute_data;
  320|    118|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 118]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|    118|  uint32_t num_encoded_symbols;
  325|    118|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|    118|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    118|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 25, False: 93]
  ------------------
  327|     25|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 25]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|     25|  } else
  332|     93|#endif
  333|     93|  {
  334|     93|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 93]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|     93|  }
  338|       |
  339|    118|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 1, False: 117]
  ------------------
  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|      1|    return false;
  344|      1|  }
  345|    117|  const uint32_t max_encoded_faces =
  346|    117|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|    117|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 0, False: 117]
  ------------------
  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|      0|    return false;
  352|      0|  }
  353|       |
  354|    117|  uint32_t num_encoded_split_symbols;
  355|    117|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|    117|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    117|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 24, False: 93]
  ------------------
  357|     24|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 24]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|     24|  } else
  362|     93|#endif
  363|     93|  {
  364|     93|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 93]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|     93|  }
  368|       |
  369|    117|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 0, False: 117]
  ------------------
  370|      0|    return false;  // Split symbols are a sub-set of all symbols.
  371|      0|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|    117|  vertex_traversal_length_.clear();
  375|    117|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|    117|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 117]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|    117|  processed_corner_ids_.clear();
  380|    117|  processed_corner_ids_.reserve(num_faces);
  381|    117|  processed_connectivity_corners_.clear();
  382|    117|  processed_connectivity_corners_.reserve(num_faces);
  383|    117|  topology_split_data_.clear();
  384|    117|  hole_event_data_.clear();
  385|    117|  init_face_configurations_.clear();
  386|    117|  init_corners_.clear();
  387|       |
  388|    117|  last_symbol_id_ = -1;
  389|    117|  last_face_id_ = -1;
  390|    117|  last_vert_id_ = -1;
  391|       |
  392|    117|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|    117|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|    117|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 117]
  ------------------
  397|    117|          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|    117|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|    117|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|    117|  int32_t topology_split_decoded_bytes = -1;
  410|    117|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    117|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 25, False: 92]
  ------------------
  411|     25|    uint32_t encoded_connectivity_size;
  412|     25|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     25|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 24, False: 1]
  ------------------
  413|     24|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 0, False: 24]
  ------------------
  414|      0|        return false;
  415|      0|      }
  416|     24|    } else {
  417|      1|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 1]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|      1|    }
  421|     25|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 0, False: 25]
  ------------------
  422|     25|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 0, False: 25]
  ------------------
  423|      0|      return false;
  424|      0|    }
  425|     25|    DecoderBuffer event_buffer;
  426|     25|    event_buffer.Init(
  427|     25|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|     25|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|     25|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|     25|    topology_split_decoded_bytes =
  432|     25|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|     25|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 13, False: 12]
  ------------------
  434|     13|      return false;
  435|     13|    }
  436|       |
  437|     25|  } else
  438|     92|#endif
  439|     92|  {
  440|     92|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 0, False: 92]
  ------------------
  441|      0|      return false;
  442|      0|    }
  443|     92|  }
  444|       |
  445|    104|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|    104|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|    104|                                           num_encoded_split_symbols);
  449|    104|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|    104|  DecoderBuffer traversal_end_buffer;
  452|    104|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 55, False: 49]
  ------------------
  453|     55|    return false;
  454|     55|  }
  455|       |
  456|     49|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|     49|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 37, False: 12]
  ------------------
  458|     37|    return false;
  459|     37|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|     12|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|     12|                           traversal_end_buffer.remaining_size(),
  464|     12|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|     12|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|     12|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     12|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 0, False: 12]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      0|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      0|  }
  471|     12|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|     12|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 12, False: 0]
  ------------------
  475|     12|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|     12|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|     12|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 0, False: 12]
  ------------------
  477|      0|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 0, False: 0]
  ------------------
  478|      0|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 0]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|      0|      }
  482|       |
  483|      0|    } else
  484|     12|#endif
  485|     12|    {
  486|     25|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 13, False: 12]
  ------------------
  487|     13|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 13]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|     13|      }
  491|     12|    }
  492|     12|  }
  493|     12|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|     25|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 13, False: 12]
  ------------------
  498|     13|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|     39|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 39, False: 13]
  ------------------
  501|     39|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|     39|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|     13|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 13]
  ------------------
  505|     13|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|     13|  }
  509|       |
  510|     12|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|     25|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 13, False: 12]
  ------------------
  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|     13|    int32_t att_connectivity_verts =
  517|     13|        attribute_data_[i].connectivity_data.num_vertices();
  518|     13|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 0, False: 13]
  ------------------
  519|      0|      att_connectivity_verts = corner_table_->num_vertices();
  520|      0|    }
  521|     13|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|     13|  }
  523|     12|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 0, False: 12]
  ------------------
  524|      0|    return false;
  525|      0|  }
  526|     12|  return true;
  527|     12|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|      1|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|      1|  return true;
  532|      1|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|     49|    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|     49|  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|     49|  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|     49|  std::vector<VertexIndex> invalid_vertices;
  558|     49|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|     49|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|     49|  int num_faces = 0;
  562|  3.43k|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 3.42k, False: 12]
  ------------------
  563|  3.42k|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  3.42k|    bool check_topology_split = false;
  566|  3.42k|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  3.42k|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 118, False: 3.30k]
  ------------------
  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|    118|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 4, False: 114]
  ------------------
  588|      4|        return -1;
  589|      4|      }
  590|       |
  591|    114|      const CornerIndex corner_a = active_corner_stack.back();
  592|    114|      const VertexIndex vertex_x =
  593|    114|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|    114|      const CornerIndex corner_b =
  595|    114|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|    114|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 20, False: 94]
  ------------------
  598|       |        // All matched corners must be different.
  599|     20|        return -1;
  600|     20|      }
  601|     94|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 94]
  |  Branch (601:11): [True: 0, False: 94]
  ------------------
  602|     94|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 94]
  ------------------
  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|     94|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|     94|      SetOppositeCorners(corner_a, corner + 1);
  612|     94|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|     94|      const VertexIndex vert_a_prev =
  616|     94|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|     94|      const VertexIndex vert_b_next =
  618|     94|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|     94|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 94]
  |  Branch (619:38): [True: 0, False: 94]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|     94|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|     94|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|     94|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|     94|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|     94|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|     94|      active_corner_stack.back() = corner;
  631|  3.30k|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 3, False: 3.30k]
  |  Branch (631:40): [True: 3.24k, False: 60]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  3.24k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 3.24k]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  3.24k|      const CornerIndex corner_a = active_corner_stack.back();
  650|  3.24k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 3.24k]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  3.24k|      const CornerIndex corner(3 * face.value());
  658|  3.24k|      CornerIndex opp_corner, corner_l, corner_r;
  659|  3.24k|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 3, False: 3.24k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|      3|        opp_corner = corner + 2;
  662|      3|        corner_l = corner + 1;
  663|      3|        corner_r = corner;
  664|  3.24k|      } else {
  665|       |        // "l" is the new first corner.
  666|  3.24k|        opp_corner = corner + 1;
  667|  3.24k|        corner_l = corner;
  668|  3.24k|        corner_r = corner + 2;
  669|  3.24k|      }
  670|  3.24k|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  3.24k|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  3.24k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 0, False: 3.24k]
  ------------------
  675|      0|        return -1;  // Unexpected number of decoded vertices.
  676|      0|      }
  677|       |
  678|  3.24k|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  3.24k|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  3.24k|      const VertexIndex vertex_r =
  682|  3.24k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  3.24k|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  3.24k|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  3.24k|      corner_table_->MapCornerToVertex(
  688|  3.24k|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  3.24k|      active_corner_stack.back() = corner;
  690|  3.24k|      check_topology_split = true;
  691|  3.24k|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 5, False: 55]
  ------------------
  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|      5|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 5]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|      5|      const CornerIndex corner_b = active_corner_stack.back();
  706|      5|      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|      5|      const auto it = topology_split_active_corners.find(symbol_id);
  711|      5|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 0, False: 5]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|      0|        active_corner_stack.push_back(it->second);
  714|      0|      }
  715|      5|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 5, False: 0]
  ------------------
  716|      5|        return -1;
  717|      5|      }
  718|      0|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|      0|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 0]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|      0|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 0, False: 0]
  |  Branch (724:11): [True: 0, False: 0]
  ------------------
  725|      0|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 0]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      0|        return -1;
  729|      0|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|      0|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|      0|      SetOppositeCorners(corner_a, corner + 2);
  735|      0|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|      0|      const VertexIndex vertex_p =
  739|      0|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|      0|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|      0|      corner_table_->MapCornerToVertex(
  742|      0|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|      0|      const VertexIndex vert_b_prev =
  744|      0|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|      0|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|      0|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|      0|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|      0|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|      0|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|      0|      corner_table_->SetLeftMostCorner(vertex_p,
  752|      0|                                       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|      0|      const CornerIndex first_corner = corner_n;
  757|      0|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 0, False: 0]
  ------------------
  758|      0|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|      0|        corner_n = corner_table_->SwingLeft(corner_n);
  760|      0|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 0, False: 0]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      0|          return -1;
  764|      0|        }
  765|      0|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|      0|      corner_table_->MakeVertexIsolated(vertex_n);
  769|      0|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 0, False: 0]
  ------------------
  770|      0|        invalid_vertices.push_back(vertex_n);
  771|      0|      }
  772|      0|      active_corner_stack.back() = corner;
  773|     55|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 47, False: 8]
  ------------------
  774|     47|      const CornerIndex corner(3 * face.value());
  775|     47|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|     47|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|     47|      corner_table_->MapCornerToVertex(corner + 1,
  779|     47|                                       corner_table_->AddNewVertex());
  780|     47|      corner_table_->MapCornerToVertex(corner + 2,
  781|     47|                                       corner_table_->AddNewVertex());
  782|       |
  783|     47|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 0, False: 47]
  ------------------
  784|      0|        return -1;  // Unexpected number of decoded vertices.
  785|      0|      }
  786|       |
  787|     47|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|     47|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|     47|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|     47|      active_corner_stack.push_back(corner);
  792|     47|      check_topology_split = true;
  793|     47|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      8|      return -1;
  796|      8|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  3.38k|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  3.38k|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 3.29k, False: 94]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  3.29k|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  3.29k|      EdgeFaceName split_edge;
  812|  3.29k|      int encoder_split_symbol_id;
  813|  3.29k|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 0, False: 3.29k]
  ------------------
  814|  3.29k|                             &encoder_split_symbol_id)) {
  815|      0|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 0, False: 0]
  ------------------
  816|      0|          return -1;  // Wrong split symbol id.
  817|      0|        }
  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|      0|        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|      0|        CornerIndex new_active_corner;
  831|      0|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 0, False: 0]
  ------------------
  832|      0|          new_active_corner = corner_table_->Next(act_top_corner);
  833|      0|        } else {
  834|      0|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|      0|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|      0|        const int decoder_split_symbol_id =
  839|      0|            num_symbols - encoder_split_symbol_id - 1;
  840|      0|        topology_split_active_corners[decoder_split_symbol_id] =
  841|      0|            new_active_corner;
  842|      0|      }
  843|  3.29k|    }
  844|  3.38k|  }
  845|     12|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 12]
  ------------------
  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|     24|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 12, False: 12]
  ------------------
  850|     12|    const CornerIndex corner = active_corner_stack.back();
  851|     12|    active_corner_stack.pop_back();
  852|     12|    const bool interior_face =
  853|     12|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|     12|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 0, False: 12]
  ------------------
  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|      0|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 0, False: 0]
  ------------------
  877|      0|        return -1;  // More faces than expected added to the mesh.
  878|      0|      }
  879|       |
  880|      0|      const CornerIndex corner_a = corner;
  881|      0|      const VertexIndex vert_n =
  882|      0|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|      0|      const CornerIndex corner_b =
  884|      0|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|      0|      const VertexIndex vert_x =
  887|      0|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|      0|      const CornerIndex corner_c =
  889|      0|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|      0|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 0, False: 0]
  |  Branch (891:33): [True: 0, False: 0]
  |  Branch (891:55): [True: 0, False: 0]
  ------------------
  892|       |        // All matched corners must be different.
  893|      0|        return -1;
  894|      0|      }
  895|      0|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 0]
  |  Branch (895:11): [True: 0, False: 0]
  ------------------
  896|      0|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 0]
  ------------------
  897|      0|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 0]
  ------------------
  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|      0|      const VertexIndex vert_p =
  904|      0|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|      0|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|      0|      const CornerIndex new_corner(3 * face.value());
  909|      0|      SetOppositeCorners(new_corner, corner);
  910|      0|      SetOppositeCorners(new_corner + 1, corner_b);
  911|      0|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|      0|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|      0|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|      0|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|      0|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 0, False: 0]
  ------------------
  920|      0|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|      0|      }
  922|       |
  923|      0|      init_face_configurations_.push_back(true);
  924|      0|      init_corners_.push_back(new_corner);
  925|     12|    } 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|     12|      init_face_configurations_.push_back(false);
  930|     12|      init_corners_.push_back(corner);
  931|     12|    }
  932|     12|  }
  933|     12|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 0, False: 12]
  ------------------
  934|      0|    return -1;  // Unexpected number of decoded faces.
  935|      0|  }
  936|       |
  937|     12|  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|     12|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 0, False: 12]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|      0|    VertexIndex src_vert(num_vertices - 1);
  943|      0|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 0, False: 0]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|      0|      src_vert = VertexIndex(--num_vertices - 1);
  946|      0|    }
  947|      0|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 0, False: 0]
  ------------------
  948|      0|      continue;  // No need to swap anything.
  949|      0|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|      0|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|      0|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 0, False: 0]
  ------------------
  954|      0|      const CornerIndex cid = vcit.Corner();
  955|      0|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 0, False: 0]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      0|        return -1;
  959|      0|      }
  960|      0|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|      0|    }
  962|      0|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|      0|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|      0|    corner_table_->MakeVertexIsolated(src_vert);
  967|      0|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|      0|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|      0|    num_vertices--;
  972|      0|  }
  973|     12|  return num_vertices;
  974|     12|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|    117|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|    117|  uint32_t num_topology_splits;
  982|    117|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|    117|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    117|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 24, False: 93]
  ------------------
  984|     24|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 0, False: 24]
  ------------------
  985|      0|      return -1;
  986|      0|    }
  987|       |
  988|     24|  } else
  989|     93|#endif
  990|     93|  {
  991|     93|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 1, False: 92]
  ------------------
  992|      1|      return -1;
  993|      1|    }
  994|     93|  }
  995|    116|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 29, False: 87]
  ------------------
  996|     29|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 2, False: 27]
  ------------------
  997|     29|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|      2|      return -1;
  999|      2|    }
 1000|     27|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|     27|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     27|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 9, False: 18]
  ------------------
 1002|  45.1k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 45.1k, False: 3]
  ------------------
 1003|  45.1k|        TopologySplitEventData event_data;
 1004|  45.1k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 1, False: 45.1k]
  ------------------
 1005|      1|          return -1;
 1006|      1|        }
 1007|  45.1k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 5, False: 45.1k]
  ------------------
 1008|      5|          return -1;
 1009|      5|        }
 1010|  45.1k|        uint8_t edge_data;
 1011|  45.1k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 0, False: 45.1k]
  ------------------
 1012|      0|          return -1;
 1013|      0|        }
 1014|  45.1k|        event_data.source_edge = edge_data & 1;
 1015|  45.1k|        topology_split_data_.push_back(event_data);
 1016|  45.1k|      }
 1017|       |
 1018|      9|    } else
 1019|     18|#endif
 1020|     18|    {
 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|     18|      int last_source_symbol_id = 0;
 1024|    110|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 92, False: 18]
  ------------------
 1025|     92|        TopologySplitEventData event_data;
 1026|     92|        uint32_t delta;
 1027|     92|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 0, False: 92]
  ------------------
 1028|      0|          return -1;
 1029|      0|        }
 1030|     92|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|     92|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 0, False: 92]
  ------------------
 1032|      0|          return -1;
 1033|      0|        }
 1034|     92|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 0, False: 92]
  ------------------
 1035|      0|          return -1;
 1036|      0|        }
 1037|     92|        event_data.split_symbol_id =
 1038|     92|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|     92|        last_source_symbol_id = event_data.source_symbol_id;
 1040|     92|        topology_split_data_.push_back(event_data);
 1041|     92|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|     18|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|    110|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 92, False: 18]
  ------------------
 1045|     92|        uint32_t edge_data;
 1046|     92|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     92|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 0, False: 92]
  ------------------
 1047|      0|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|     92|        } else {
 1049|     92|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|     92|        }
 1051|     92|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|     92|        event_data.source_edge = edge_data & 1;
 1053|     92|      }
 1054|     18|      decoder_buffer->EndBitDecoding();
 1055|     18|    }
 1056|     27|  }
 1057|    108|  uint32_t num_hole_events = 0;
 1058|    108|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|    108|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    108|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 16, False: 92]
  ------------------
 1060|     16|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 0, False: 16]
  ------------------
 1061|      0|      return -1;
 1062|      0|    }
 1063|     92|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|     92|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 0, False: 92]
  ------------------
 1064|      0|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 0, False: 0]
  ------------------
 1065|      0|      return -1;
 1066|      0|    }
 1067|      0|  }
 1068|    108|#endif
 1069|    108|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 4, False: 104]
  ------------------
 1070|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|      4|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 3, False: 1]
  ------------------
 1072|   105k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 105k, False: 0]
  ------------------
 1073|   105k|        HoleEventData event_data;
 1074|   105k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 3, False: 105k]
  ------------------
 1075|      3|          return -1;
 1076|      3|        }
 1077|   105k|        hole_event_data_.push_back(event_data);
 1078|   105k|      }
 1079|       |
 1080|      3|    } else
 1081|      1|#endif
 1082|      1|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|      1|      int last_symbol_id = 0;
 1085|      1|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 1, False: 0]
  ------------------
 1086|      1|        HoleEventData event_data;
 1087|      1|        uint32_t delta;
 1088|      1|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 1, False: 0]
  ------------------
 1089|      1|          return -1;
 1090|      1|        }
 1091|      0|        event_data.symbol_id = delta + last_symbol_id;
 1092|      0|        last_symbol_id = event_data.symbol_id;
 1093|      0|        hole_event_data_.push_back(event_data);
 1094|      0|      }
 1095|      1|    }
 1096|      4|  }
 1097|    104|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|    108|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|     13|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|     13|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|     13|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|     13|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|     52|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 39, False: 13]
  ------------------
 1139|     39|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|     39|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 35, False: 4]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|     72|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 37, False: 35]
  ------------------
 1144|     37|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|     37|      }
 1146|     35|      continue;
 1147|     35|    }
 1148|      4|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|      4|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 2, False: 2]
  ------------------
 1151|      2|      continue;
 1152|      2|    }
 1153|       |
 1154|      6|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 4, False: 2]
  ------------------
 1155|      4|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|      4|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 2, False: 2]
  ------------------
 1157|      2|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|      2|      }
 1159|      4|    }
 1160|      2|  }
 1161|     13|  return true;
 1162|     13|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|     12|    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|     12|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|     12|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 0, False: 12]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|      0|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 0, False: 0]
  ------------------
 1176|      0|      Mesh::Face face;
 1177|      0|      const CornerIndex start_corner(3 * f.value());
 1178|      0|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 0, False: 0]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|      0|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|      0|        face[c] = vert_id;
 1182|      0|      }
 1183|      0|      decoder_->mesh()->SetFace(f, face);
 1184|      0|    }
 1185|      0|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|      0|    return true;
 1187|      0|  }
 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|     12|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|     12|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|     48|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 36, False: 12]
  ------------------
 1197|     36|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|     36|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 0, False: 36]
  ------------------
 1199|      0|      continue;  // Isolated vertex.
 1200|      0|    }
 1201|     36|    CornerIndex deduplication_first_corner = c;
 1202|     36|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 35, False: 1]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|     35|      deduplication_first_corner = c;
 1206|     35|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|      3|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 2, False: 1]
  ------------------
 1210|      2|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 0, False: 2]
  ------------------
 1211|      0|          continue;  // No seam for this attribute, ignore it.
 1212|      0|        }
 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|      2|        const VertexIndex vert_id =
 1217|      2|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|      2|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|      2|        bool seam_found = false;
 1220|      4|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 2, False: 2]
  ------------------
 1221|      2|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 0, False: 2]
  ------------------
 1222|      0|            return false;
 1223|      0|          }
 1224|      2|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 0, False: 2]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|      0|            deduplication_first_corner = act_c;
 1227|      0|            seam_found = true;
 1228|      0|            break;
 1229|      0|          }
 1230|      2|          act_c = corner_table_->SwingRight(act_c);
 1231|      2|        }
 1232|      2|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 0, False: 2]
  ------------------
 1233|      0|          break;  // No reason to process other attributes if we found a seam.
 1234|      0|        }
 1235|      2|      }
 1236|      1|    }
 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|     36|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|     36|    corner_to_point_map[c.value()] =
 1246|     36|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|     36|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|     36|    CornerIndex prev_c = c;
 1250|     36|    c = corner_table_->SwingRight(c);
 1251|     39|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 4, False: 35]
  |  Branch (1251:40): [True: 3, False: 1]
  ------------------
 1252|      3|      bool attribute_seam = false;
 1253|      7|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 5, False: 2]
  ------------------
 1254|      5|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 1, False: 4]
  ------------------
 1255|      5|            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|      1|          attribute_seam = true;
 1259|      1|          break;
 1260|      1|        }
 1261|      5|      }
 1262|      3|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 1, False: 2]
  ------------------
 1263|      1|        corner_to_point_map[c.value()] =
 1264|      1|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|      1|        point_to_corner_map.push_back(c.value());
 1266|      2|      } else {
 1267|      2|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|      2|      }
 1269|      3|      prev_c = c;
 1270|      3|      c = corner_table_->SwingRight(c);
 1271|      3|    }
 1272|     36|  }
 1273|       |  // Add faces.
 1274|     25|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 13, False: 12]
  ------------------
 1275|     13|    Mesh::Face face;
 1276|     52|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 39, False: 13]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|     39|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|     39|    }
 1280|     13|    decoder_->mesh()->SetFace(f, face);
 1281|     13|  }
 1282|     12|  decoder_->point_cloud()->set_num_points(
 1283|     12|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|     12|  return true;
 1285|     12|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|      1|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|      1|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|      1|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|      1|  const Mesh *mesh = decoder_->mesh();
  115|      1|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|      1|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|      1|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|      1|                           encoding_data);
  120|       |
  121|      1|  TraverserT att_traverser;
  122|      1|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|      1|  traversal_sequencer->SetTraverser(att_traverser);
  125|      1|  return std::move(traversal_sequencer);
  126|      1|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     22|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     22|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     22|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     22|  const Mesh *mesh = decoder_->mesh();
  115|     22|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     22|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     22|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     22|                           encoding_data);
  120|       |
  121|     22|  TraverserT att_traverser;
  122|     22|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     22|  traversal_sequencer->SetTraverser(att_traverser);
  125|     22|  return std::move(traversal_sequencer);
  126|     22|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|      4|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|      4|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|      4|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|      4|  const Mesh *mesh = decoder_->mesh();
  115|      4|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|      4|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|      4|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|      4|                           encoding_data);
  120|       |
  121|      4|  TraverserT att_traverser;
  122|      4|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|      4|  traversal_sequencer->SetTraverser(att_traverser);
  125|      4|  return std::move(traversal_sequencer);
  126|      4|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    105|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    105|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    105|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    105|  const Mesh *mesh = decoder_->mesh();
  115|    105|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    105|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    105|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    105|                           encoding_data);
  120|       |
  121|    105|  TraverserT att_traverser;
  122|    105|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    105|  traversal_sequencer->SetTraverser(att_traverser);
  125|    105|  return std::move(traversal_sequencer);
  126|    105|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|      1|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|      1|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|      1|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|      1|  const Mesh *mesh = decoder_->mesh();
  115|      1|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|      1|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|      1|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|      1|                           encoding_data);
  120|       |
  121|      1|  TraverserT att_traverser;
  122|      1|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|      1|  traversal_sequencer->SetTraverser(att_traverser);
  125|      1|  return std::move(traversal_sequencer);
  126|      1|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|    594|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|    212|  const CornerTable *GetCornerTable() const override {
   67|    212|    return corner_table_.get();
   68|    212|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  7.47M|                       int *out_encoder_split_symbol_id) {
   87|  7.47M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 5.35k, False: 7.46M]
  ------------------
   88|  5.35k|      return false;
   89|  5.35k|    }
   90|  7.46M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 1, False: 7.46M]
  ------------------
   91|  7.46M|        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|      1|      *out_encoder_split_symbol_id = -1;
   98|      1|      return true;
   99|      1|    }
  100|  7.46M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 7.46M, False: 32]
  ------------------
  101|  7.46M|      return false;
  102|  7.46M|    }
  103|     32|    *out_face_edge =
  104|     32|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|     32|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|     32|    topology_split_data_.pop_back();
  108|     32|    return true;
  109|  7.46M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  23.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  23.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  23.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  23.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  1.01k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|    447|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|    431|  const CornerTable *GetCornerTable() const override {
   67|    431|    return corner_table_.get();
   68|    431|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  1.23M|                       int *out_encoder_split_symbol_id) {
   87|  1.23M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.23M, False: 1.35k]
  ------------------
   88|  1.23M|      return false;
   89|  1.23M|    }
   90|  1.35k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 0, False: 1.35k]
  ------------------
   91|  1.35k|        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|      0|      *out_encoder_split_symbol_id = -1;
   98|      0|      return true;
   99|      0|    }
  100|  1.35k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 1.29k, False: 62]
  ------------------
  101|  1.29k|      return false;
  102|  1.29k|    }
  103|     62|    *out_face_edge =
  104|     62|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|     62|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|     62|    topology_split_data_.pop_back();
  108|     62|    return true;
  109|  1.35k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  3.67M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  3.67M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  3.67M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  3.67M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|    274|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|    576|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|    108|  const CornerTable *GetCornerTable() const override {
   67|    108|    return corner_table_.get();
   68|    108|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  3.29k|                       int *out_encoder_split_symbol_id) {
   87|  3.29k|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 3.28k, False: 10]
  ------------------
   88|  3.28k|      return false;
   89|  3.28k|    }
   90|     10|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 0, False: 10]
  ------------------
   91|     10|        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|      0|      *out_encoder_split_symbol_id = -1;
   98|      0|      return true;
   99|      0|    }
  100|     10|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 10, False: 0]
  ------------------
  101|     10|      return false;
  102|     10|    }
  103|      0|    *out_face_edge =
  104|      0|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|      0|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|      0|    topology_split_data_.pop_back();
  108|      0|    return true;
  109|     10|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  3.43k|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  3.43k|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  3.43k|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  3.43k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  1.79k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|    510|      : attribute_connectivity_decoders_(nullptr),
   34|    510|        num_attribute_data_(0),
   35|    510|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|    451|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|    451|    decoder_impl_ = decoder;
   38|    451|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|    451|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|    451|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|    451|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|    264|  uint16_t BitstreamVersion() const {
   45|    264|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|    264|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|    198|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|    451|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|    347|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|    347|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 3, False: 344]
  ------------------
   63|      3|      return false;
   64|      3|    }
   65|       |
   66|    344|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 5, False: 339]
  ------------------
   67|      5|      return false;
   68|      5|    }
   69|       |
   70|    339|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 2, False: 337]
  ------------------
   71|      2|      return false;
   72|      2|    }
   73|    337|    *out_buffer = buffer_;
   74|    337|    return true;
   75|    339|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  54.2k|  inline bool DecodeStartFaceConfiguration() {
   79|  54.2k|    uint32_t face_configuration;
   80|  54.2k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  54.2k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  54.2k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 42, False: 54.1k]
  ------------------
   82|     42|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|     42|    } else
   85|  54.1k|#endif
   86|  54.1k|    {
   87|  54.1k|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  54.1k|    }
   89|  54.2k|    return face_configuration;
   90|  54.2k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  17.7M|  inline uint32_t DecodeSymbol() {
   94|  17.7M|    uint32_t symbol;
   95|  17.7M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  17.7M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 8.38M, False: 9.39M]
  ------------------
   97|  8.38M|      return symbol;
   98|  8.38M|    }
   99|       |    // Else decode two additional bits.
  100|  9.39M|    uint32_t symbol_suffix;
  101|  9.39M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  9.39M|    symbol |= (symbol_suffix << 1);
  103|  9.39M|    return symbol;
  104|  17.7M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  17.7M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  1.91M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  4.60M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  4.60M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  4.60M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|    278|  void Done() {
  123|    278|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 266, False: 12]
  ------------------
  124|    266|      symbol_buffer_.EndBitDecoding();
  125|    266|    }
  126|    278|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|    278|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    278|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 37, False: 241]
  ------------------
  128|     37|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|     37|    } else
  131|    241|#endif
  132|    241|    {
  133|    241|      start_face_decoder_.EndDecoding();
  134|    241|    }
  135|    278|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|    101|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|    359|  bool DecodeTraversalSymbols() {
  141|    359|    uint64_t traversal_size;
  142|    359|    symbol_buffer_ = buffer_;
  143|    359|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 0, False: 359]
  ------------------
  144|      0|      return false;
  145|      0|    }
  146|    359|    buffer_ = symbol_buffer_;
  147|    359|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 3, False: 356]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    356|    buffer_.Advance(traversal_size);
  151|    356|    return true;
  152|    359|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|    448|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|    448|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|    448|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    448|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 54, False: 394]
  ------------------
  158|     54|      start_face_buffer_ = buffer_;
  159|     54|      uint64_t traversal_size;
  160|     54|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 0, False: 54]
  ------------------
  161|      0|        return false;
  162|      0|      }
  163|     54|      buffer_ = start_face_buffer_;
  164|     54|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 7, False: 47]
  ------------------
  165|      7|        return false;
  166|      7|      }
  167|     47|      buffer_.Advance(traversal_size);
  168|     47|      return true;
  169|     54|    }
  170|    394|#endif
  171|    394|    return start_face_decoder_.StartDecoding(&buffer_);
  172|    448|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|    441|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|    441|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 324, False: 117]
  ------------------
  177|    324|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|    324|          new BinaryDecoder[num_attribute_data_]);
  179|  1.37k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 1.05k, False: 321]
  ------------------
  180|  1.05k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 3, False: 1.04k]
  ------------------
  181|      3|          return false;
  182|      3|        }
  183|  1.05k|      }
  184|    324|    }
  185|    438|    return true;
  186|    441|  }

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    125|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|   638k|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|   638k|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 637k, False: 492]
  ------------------
   61|   637k|      return true;  // Already traversed.
   62|   637k|    }
   63|       |
   64|    492|    corner_traversal_stack_.clear();
   65|    492|    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|    492|    const VertexIndex next_vert =
   69|    492|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|    492|    const VertexIndex prev_vert =
   71|    492|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|    492|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 492]
  |  Branch (72:45): [True: 0, False: 492]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|    492|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 484, False: 8]
  ------------------
   76|    484|      this->MarkVertexVisited(next_vert);
   77|    484|      this->traversal_observer().OnNewVertexVisited(
   78|    484|          next_vert, this->corner_table()->Next(corner_id));
   79|    484|    }
   80|    492|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 461, False: 31]
  ------------------
   81|    461|      this->MarkVertexVisited(prev_vert);
   82|    461|      this->traversal_observer().OnNewVertexVisited(
   83|    461|          prev_vert, this->corner_table()->Previous(corner_id));
   84|    461|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  3.21k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.72k, False: 492]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.72k|      corner_id = corner_traversal_stack_.back();
   90|  2.72k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.72k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.72k]
  |  Branch (92:47): [True: 110, False: 2.61k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    110|        corner_traversal_stack_.pop_back();
   95|    110|        continue;
   96|    110|      }
   97|   638k|      while (true) {
  ------------------
  |  Branch (97:14): [True: 638k, Folded]
  ------------------
   98|   638k|        this->MarkFaceVisited(face_id);
   99|   638k|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|   638k|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|   638k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 638k]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|   638k|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 319k, False: 318k]
  ------------------
  105|   319k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   319k|          this->MarkVertexVisited(vert_id);
  107|   319k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   319k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 318k, False: 1.15k]
  ------------------
  109|   318k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   318k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   318k|            continue;
  112|   318k|          }
  113|   319k|        }
  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|   319k|        const CornerIndex right_corner_id =
  118|   319k|            this->corner_table()->GetRightCorner(corner_id);
  119|   319k|        const CornerIndex left_corner_id =
  120|   319k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   319k|        const FaceIndex right_face_id(
  122|   319k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 901, False: 319k]
  ------------------
  123|   319k|                 ? kInvalidFaceIndex
  124|   319k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   319k|        const FaceIndex left_face_id(
  126|   319k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 570, False: 319k]
  ------------------
  127|   319k|                 ? kInvalidFaceIndex
  128|   319k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   319k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 317k, False: 2.06k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   317k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.49k, False: 316k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.49k|            corner_traversal_stack_.pop_back();
  134|  1.49k|            break;  // Break from the while (true) loop.
  135|   316k|          } else {
  136|       |            // Go to the left face.
  137|   316k|            corner_id = left_corner_id;
  138|   316k|            face_id = left_face_id;
  139|   316k|          }
  140|   317k|        } else {
  141|       |          // Right face was not visited.
  142|  2.06k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 950, False: 1.11k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|    950|            corner_id = right_corner_id;
  145|    950|            face_id = right_face_id;
  146|  1.11k|          } 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|  1.11k|            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|  1.11k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  1.11k|            break;
  159|  1.11k|          }
  160|  2.06k|        }
  161|   319k|      }
  162|  2.61k|    }
  163|    492|    return true;
  164|    492|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    125|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|    254|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    112|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  18.5k|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  18.5k|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 8.85k, False: 9.71k]
  ------------------
   61|  8.85k|      return true;  // Already traversed.
   62|  8.85k|    }
   63|       |
   64|  9.71k|    corner_traversal_stack_.clear();
   65|  9.71k|    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|  9.71k|    const VertexIndex next_vert =
   69|  9.71k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  9.71k|    const VertexIndex prev_vert =
   71|  9.71k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  9.71k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 9.71k]
  |  Branch (72:45): [True: 0, False: 9.71k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  9.71k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 9.59k, False: 122]
  ------------------
   76|  9.59k|      this->MarkVertexVisited(next_vert);
   77|  9.59k|      this->traversal_observer().OnNewVertexVisited(
   78|  9.59k|          next_vert, this->corner_table()->Next(corner_id));
   79|  9.59k|    }
   80|  9.71k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 9.56k, False: 157]
  ------------------
   81|  9.56k|      this->MarkVertexVisited(prev_vert);
   82|  9.56k|      this->traversal_observer().OnNewVertexVisited(
   83|  9.56k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  9.56k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  20.2k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 10.4k, False: 9.71k]
  ------------------
   88|       |      // Currently processed corner.
   89|  10.4k|      corner_id = corner_traversal_stack_.back();
   90|  10.4k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  10.4k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 10.4k]
  |  Branch (92:47): [True: 50, False: 10.4k]
  ------------------
   93|       |        // This face has been already traversed.
   94|     50|        corner_traversal_stack_.pop_back();
   95|     50|        continue;
   96|     50|      }
   97|  18.5k|      while (true) {
  ------------------
  |  Branch (97:14): [True: 18.5k, Folded]
  ------------------
   98|  18.5k|        this->MarkFaceVisited(face_id);
   99|  18.5k|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  18.5k|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  18.5k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 18.5k]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  18.5k|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 14.2k, False: 4.35k]
  ------------------
  105|  14.2k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  14.2k|          this->MarkVertexVisited(vert_id);
  107|  14.2k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  14.2k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 3.90k, False: 10.3k]
  ------------------
  109|  3.90k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  3.90k|            face_id = FaceIndex(corner_id.value() / 3);
  111|  3.90k|            continue;
  112|  3.90k|          }
  113|  14.2k|        }
  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|  14.6k|        const CornerIndex right_corner_id =
  118|  14.6k|            this->corner_table()->GetRightCorner(corner_id);
  119|  14.6k|        const CornerIndex left_corner_id =
  120|  14.6k|            this->corner_table()->GetLeftCorner(corner_id);
  121|  14.6k|        const FaceIndex right_face_id(
  122|  14.6k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 10.0k, False: 4.62k]
  ------------------
  123|  14.6k|                 ? kInvalidFaceIndex
  124|  14.6k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  14.6k|        const FaceIndex left_face_id(
  126|  14.6k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 9.99k, False: 4.67k]
  ------------------
  127|  14.6k|                 ? kInvalidFaceIndex
  128|  14.6k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  14.6k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 13.9k, False: 724]
  ------------------
  130|       |          // Right face has been already visited.
  131|  13.9k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 10.0k, False: 3.88k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  10.0k|            corner_traversal_stack_.pop_back();
  134|  10.0k|            break;  // Break from the while (true) loop.
  135|  10.0k|          } else {
  136|       |            // Go to the left face.
  137|  3.88k|            corner_id = left_corner_id;
  138|  3.88k|            face_id = left_face_id;
  139|  3.88k|          }
  140|  13.9k|        } else {
  141|       |          // Right face was not visited.
  142|    724|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 339, False: 385]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|    339|            corner_id = right_corner_id;
  145|    339|            face_id = right_face_id;
  146|    385|          } 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|    385|            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|    385|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|    385|            break;
  159|    385|          }
  160|    724|        }
  161|  14.6k|      }
  162|  10.4k|    }
  163|  9.71k|    return true;
  164|  9.71k|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    112|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|    234|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|      6|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|     47|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|     47|    const auto *corner_table = traverser_.corner_table();
   50|     47|    attribute->SetExplicitMapping(mesh_->num_points());
   51|     47|    const size_t num_faces = mesh_->num_faces();
   52|     47|    const size_t num_points = mesh_->num_points();
   53|   100k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 100k, False: 47]
  ------------------
   54|   100k|      const auto &face = mesh_->face(f);
   55|   400k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 300k, False: 100k]
  ------------------
   56|   300k|        const PointIndex point_id = face[p];
   57|   300k|        const VertexIndex vert_id =
   58|   300k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|   300k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 300k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|   300k|        const AttributeValueIndex att_entry_id(
   63|   300k|            encoding_data_
   64|   300k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|   300k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 300k]
  |  Branch (65:13): [True: 0, False: 300k]
  |  Branch (65:39): [True: 0, False: 300k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|   300k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|   300k|      }
   71|   100k|    }
   72|     47|    return true;
   73|     47|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|      6|  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|      6|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|      6|    traverser_.OnTraversalStart();
   82|      6|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 6]
  ------------------
   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|      6|    } else {
   89|      6|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  54.9k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 54.9k, False: 6]
  ------------------
   91|  54.9k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 54.9k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  54.9k|      }
   95|      6|    }
   96|      6|    traverser_.OnTraversalEnd();
   97|      6|    return true;
   98|      6|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  54.9k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  54.9k|    return traverser_.TraverseFromCorner(corner_id);
  103|  54.9k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|      6|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    127|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    901|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    901|    const auto *corner_table = traverser_.corner_table();
   50|    901|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    901|    const size_t num_faces = mesh_->num_faces();
   52|    901|    const size_t num_points = mesh_->num_points();
   53|  1.36M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 1.35M, False: 901]
  ------------------
   54|  1.35M|      const auto &face = mesh_->face(f);
   55|  5.43M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 4.07M, False: 1.35M]
  ------------------
   56|  4.07M|        const PointIndex point_id = face[p];
   57|  4.07M|        const VertexIndex vert_id =
   58|  4.07M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  4.07M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 4.07M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  4.07M|        const AttributeValueIndex att_entry_id(
   63|  4.07M|            encoding_data_
   64|  4.07M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  4.07M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 4.07M]
  |  Branch (65:13): [True: 0, False: 4.07M]
  |  Branch (65:39): [True: 0, False: 4.07M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  4.07M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  4.07M|      }
   71|  1.35M|    }
   72|    901|    return true;
   73|    901|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    125|  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|    125|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    125|    traverser_.OnTraversalStart();
   82|    125|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 125]
  ------------------
   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|    125|    } else {
   89|    125|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|   638k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 638k, False: 125]
  ------------------
   91|   638k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 638k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|   638k|      }
   95|    125|    }
   96|    125|    traverser_.OnTraversalEnd();
   97|    125|    return true;
   98|    125|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   638k|  bool ProcessCorner(CornerIndex corner_id) {
  102|   638k|    return traverser_.TraverseFromCorner(corner_id);
  103|   638k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    127|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    117|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  2.83k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  2.83k|    const auto *corner_table = traverser_.corner_table();
   50|  2.83k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  2.83k|    const size_t num_faces = mesh_->num_faces();
   52|  2.83k|    const size_t num_points = mesh_->num_points();
   53|  91.1k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 88.2k, False: 2.83k]
  ------------------
   54|  88.2k|      const auto &face = mesh_->face(f);
   55|   353k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 264k, False: 88.2k]
  ------------------
   56|   264k|        const PointIndex point_id = face[p];
   57|   264k|        const VertexIndex vert_id =
   58|   264k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|   264k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 264k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|   264k|        const AttributeValueIndex att_entry_id(
   63|   264k|            encoding_data_
   64|   264k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|   264k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 264k]
  |  Branch (65:13): [True: 0, False: 264k]
  |  Branch (65:39): [True: 0, False: 264k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|   264k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|   264k|      }
   71|  88.2k|    }
   72|  2.83k|    return true;
   73|  2.83k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    112|  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|    112|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    112|    traverser_.OnTraversalStart();
   82|    112|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 112]
  ------------------
   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|    112|    } else {
   89|    112|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  18.6k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 18.5k, False: 112]
  ------------------
   91|  18.5k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 18.5k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  18.5k|      }
   95|    112|    }
   96|    112|    traverser_.OnTraversalEnd();
   97|    112|    return true;
   98|    112|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  18.5k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  18.5k|    return traverser_.TraverseFromCorner(corner_id);
  103|  18.5k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    117|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|    234|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  2.44M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|   941k|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|   941k|    return is_vertex_visited_[vert_id.value()];
   65|   941k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|   348k|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|   348k|    is_vertex_visited_[vert_id.value()] = true;
   68|   348k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  1.04M|  inline TraversalObserverT &traversal_observer() {
   75|  1.04M|    return traversal_observer_;
   76|  1.04M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|   852k|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|   852k|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 1.93k, False: 850k]
  ------------------
   47|  1.93k|      return true;  // Invalid faces are always considered as visited.
   48|  1.93k|    }
   49|   850k|    return is_face_visited_[face_id.value()];
   50|   852k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|   693k|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|   693k|    is_face_visited_[face_id.value()] = true;
   62|   693k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|    266|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|    266|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    133|                    TraversalObserver traversal_observer) {
   37|    133|    corner_table_ = corner_table;
   38|    133|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    133|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    133|    traversal_observer_ = traversal_observer;
   41|    133|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|   638k|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|   638k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 638k]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|   638k|    return is_face_visited_[corner_id.value() / 3];
   58|   638k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|   127k|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  18.5k|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  18.5k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 18.5k]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  18.5k|    return is_face_visited_[corner_id.value() / 3];
   58|  18.5k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  38.0k|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  38.0k|    return is_vertex_visited_[vert_id.value()];
   65|  38.0k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  33.3k|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  33.3k|    is_vertex_visited_[vert_id.value()] = true;
   68|  33.3k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  51.9k|  inline TraversalObserverT &traversal_observer() {
   75|  51.9k|    return traversal_observer_;
   76|  51.9k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  39.8k|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  39.8k|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 20.0k, False: 19.7k]
  ------------------
   47|  20.0k|      return true;  // Invalid faces are always considered as visited.
   48|  20.0k|    }
   49|  19.7k|    return is_face_visited_[face_id.value()];
   50|  39.8k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  18.5k|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  18.5k|    is_face_visited_[face_id.value()] = true;
   62|  18.5k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|    234|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    117|                    TraversalObserver traversal_observer) {
   37|    117|    corner_table_ = corner_table;
   38|    117|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    117|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    117|    traversal_observer_ = traversal_observer;
   41|    117|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     12|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     12|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 12]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     12|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 10]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|     10|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 10]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     10|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 8]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|      8|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 8]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      8|  num_decoded_points_ = 0;
  202|       |
  203|      8|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 8]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      8|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 6]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|      6|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 5]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|      5|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 5]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      5|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 5, False: 0]
  ------------------
  217|      5|    return false;
  218|      5|  }
  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|      5|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      5|    uint32_t num_points, OutputIteratorT &oit) {
  254|      5|  typedef DecodingStatus Status;
  255|      5|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      5|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      5|  DecodingStatus init_status(num_points, 0, 0);
  258|      5|  std::stack<Status> status_stack;
  259|      5|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.20k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.20k, False: 0]
  ------------------
  263|  3.20k|    const DecodingStatus status = status_stack.top();
  264|  3.20k|    status_stack.pop();
  265|       |
  266|  3.20k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.20k|    const uint32_t last_axis = status.last_axis;
  268|  3.20k|    const uint32_t stack_pos = status.stack_pos;
  269|  3.20k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.20k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.20k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.20k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.20k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.20k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.20k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.20k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.20k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 643, False: 2.56k]
  ------------------
  285|  1.92k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.28k, False: 643]
  ------------------
  286|  1.28k|        *oit = old_base;
  287|  1.28k|        ++oit;
  288|  1.28k|        ++num_decoded_points_;
  289|  1.28k|      }
  290|    643|      continue;
  291|    643|    }
  292|       |
  293|  2.56k|    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.56k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 885, False: 1.67k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    885|      axes_[0] = axis;
  300|  7.08k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 6.19k, False: 885]
  ------------------
  301|  6.19k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  6.19k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 422, False: 5.77k]
  |  |  ------------------
  ------------------
  302|  6.19k|      }
  303|  2.38k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.50k, False: 885]
  ------------------
  304|  13.5k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 12.0k, False: 1.50k]
  ------------------
  305|  12.0k|          p_[axes_[j]] = 0;
  306|  12.0k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  12.0k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.48k, False: 9.54k]
  ------------------
  308|  2.48k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 2.48k]
  ------------------
  309|  2.48k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|  2.48k|          }
  313|  12.0k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  12.0k|        }
  315|  1.50k|        *oit = p_;
  316|  1.50k|        ++oit;
  317|  1.50k|        ++num_decoded_points_;
  318|  1.50k|      }
  319|    885|      continue;
  320|    885|    }
  321|       |
  322|  1.67k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.67k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.67k|    const int num_remaining_bits = bit_length_ - level;
  327|  1.67k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.67k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.67k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.67k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.67k|    uint32_t number = 0;
  334|  1.67k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.67k|    uint32_t first_half = num_remaining_points / 2;
  337|  1.67k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 5, False: 1.67k]
  ------------------
  338|       |      // Invalid |number|.
  339|      5|      return false;
  340|      5|    }
  341|  1.67k|    first_half -= number;
  342|  1.67k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.67k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.17k, False: 501]
  ------------------
  345|  1.17k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 795, False: 377]
  ------------------
  346|    795|        std::swap(first_half, second_half);
  347|    795|      }
  348|  1.17k|    }
  349|       |
  350|  1.67k|    levels_stack_[stack_pos][axis] += 1;
  351|  1.67k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.67k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.63k, False: 43]
  ------------------
  353|  1.63k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.63k|    }
  355|  1.67k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.61k, False: 59]
  ------------------
  356|  1.61k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.61k|    }
  358|  1.67k|  }
  359|      0|  return true;
  360|      5|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  3.24k|        : num_remaining_points(num_remaining_points_),
  135|  3.24k|          last_axis(last_axis_),
  136|  3.24k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  1.67k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.67k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.67k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|      2|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|     12|      : bit_length_(0),
   87|     12|        num_points_(0),
   88|     12|        num_decoded_points_(0),
   89|     12|        dimension_(dimension),
   90|     12|        p_(dimension, 0),
   91|     12|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     12|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     12|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     19|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     19|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 19]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     19|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 18]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     18|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 18]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     18|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 16]
  ------------------
  196|      2|    return true;
  197|      2|  }
  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: 0, False: 16]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     16|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 16]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     16|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 16]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     16|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 15]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     15|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 15, False: 0]
  ------------------
  217|     15|    return false;
  218|     15|  }
  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|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     15|    uint32_t num_points, OutputIteratorT &oit) {
  254|     15|  typedef DecodingStatus Status;
  255|     15|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     15|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     15|  DecodingStatus init_status(num_points, 0, 0);
  258|     15|  std::stack<Status> status_stack;
  259|     15|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  13.1k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 13.1k, False: 0]
  ------------------
  263|  13.1k|    const DecodingStatus status = status_stack.top();
  264|  13.1k|    status_stack.pop();
  265|       |
  266|  13.1k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  13.1k|    const uint32_t last_axis = status.last_axis;
  268|  13.1k|    const uint32_t stack_pos = status.stack_pos;
  269|  13.1k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  13.1k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  13.1k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 13.1k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  13.1k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  13.1k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 13.1k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  13.1k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  13.1k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 5.03k, False: 8.08k]
  ------------------
  285|  27.3k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 22.3k, False: 5.03k]
  ------------------
  286|  22.3k|        *oit = old_base;
  287|  22.3k|        ++oit;
  288|  22.3k|        ++num_decoded_points_;
  289|  22.3k|      }
  290|  5.03k|      continue;
  291|  5.03k|    }
  292|       |
  293|  8.08k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  8.08k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.29k, False: 6.79k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.29k|      axes_[0] = axis;
  300|  10.3k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 9.03k, False: 1.29k]
  ------------------
  301|  9.03k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  9.03k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 183, False: 8.85k]
  |  |  ------------------
  ------------------
  302|  9.03k|      }
  303|  3.59k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.30k, False: 1.29k]
  ------------------
  304|  20.7k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 18.4k, False: 2.30k]
  ------------------
  305|  18.4k|          p_[axes_[j]] = 0;
  306|  18.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  18.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.64k, False: 15.7k]
  ------------------
  308|  2.64k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 2.64k]
  ------------------
  309|  2.64k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|  2.64k|          }
  313|  18.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  18.4k|        }
  315|  2.30k|        *oit = p_;
  316|  2.30k|        ++oit;
  317|  2.30k|        ++num_decoded_points_;
  318|  2.30k|      }
  319|  1.29k|      continue;
  320|  1.29k|    }
  321|       |
  322|  6.79k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 6.79k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  6.79k|    const int num_remaining_bits = bit_length_ - level;
  327|  6.79k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  6.79k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  6.79k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  6.79k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  6.79k|    uint32_t number = 0;
  334|  6.79k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  6.79k|    uint32_t first_half = num_remaining_points / 2;
  337|  6.79k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 15, False: 6.78k]
  ------------------
  338|       |      // Invalid |number|.
  339|     15|      return false;
  340|     15|    }
  341|  6.78k|    first_half -= number;
  342|  6.78k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  6.78k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 4.88k, False: 1.89k]
  ------------------
  345|  4.88k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 3.70k, False: 1.18k]
  ------------------
  346|  3.70k|        std::swap(first_half, second_half);
  347|  3.70k|      }
  348|  4.88k|    }
  349|       |
  350|  6.78k|    levels_stack_[stack_pos][axis] += 1;
  351|  6.78k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  6.78k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 6.70k, False: 76]
  ------------------
  353|  6.70k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  6.70k|    }
  355|  6.78k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 6.53k, False: 245]
  ------------------
  356|  6.53k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  6.53k|    }
  358|  6.78k|  }
  359|      0|  return true;
  360|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  13.2k|        : num_remaining_points(num_remaining_points_),
  135|  13.2k|          last_axis(last_axis_),
  136|  13.2k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  13.1k|    uint32_t last_axis) {
  232|  13.1k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 13.1k, Folded]
  ------------------
  233|  13.1k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  13.1k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.73k, False: 9.39k]
  |  |  ------------------
  ------------------
  234|  13.1k|  }
  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|  13.1k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  6.79k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  6.79k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  6.79k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|      2|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     12|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     12|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 12]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     12|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 10]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|     10|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 10]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     10|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 3, False: 7]
  ------------------
  196|      3|    return true;
  197|      3|  }
  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: 0, False: 7]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      7|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 5]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|      5|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 1]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|      1|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      1|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 1, False: 0]
  ------------------
  217|      1|    return false;
  218|      1|  }
  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|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      1|    uint32_t num_points, OutputIteratorT &oit) {
  254|      1|  typedef DecodingStatus Status;
  255|      1|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      1|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      1|  DecodingStatus init_status(num_points, 0, 0);
  258|      1|  std::stack<Status> status_stack;
  259|      1|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|      5|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 5, False: 0]
  ------------------
  263|      5|    const DecodingStatus status = status_stack.top();
  264|      5|    status_stack.pop();
  265|       |
  266|      5|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|      5|    const uint32_t last_axis = status.last_axis;
  268|      5|    const uint32_t stack_pos = status.stack_pos;
  269|      5|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|      5|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|      5|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 5]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|      5|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|      5|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 5]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|      5|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|      5|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 0, False: 5]
  ------------------
  285|      0|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 0, False: 0]
  ------------------
  286|      0|        *oit = old_base;
  287|      0|        ++oit;
  288|      0|        ++num_decoded_points_;
  289|      0|      }
  290|      0|      continue;
  291|      0|    }
  292|       |
  293|      5|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|      5|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 0, False: 5]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|      0|      axes_[0] = axis;
  300|      0|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 0, False: 0]
  ------------------
  301|      0|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|      0|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  302|      0|      }
  303|      0|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 0, False: 0]
  ------------------
  304|      0|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 0, False: 0]
  ------------------
  305|      0|          p_[axes_[j]] = 0;
  306|      0|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|      0|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 0, False: 0]
  ------------------
  308|      0|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 0]
  ------------------
  309|      0|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|      0|          }
  313|      0|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|      0|        }
  315|      0|        *oit = p_;
  316|      0|        ++oit;
  317|      0|        ++num_decoded_points_;
  318|      0|      }
  319|      0|      continue;
  320|      0|    }
  321|       |
  322|      5|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 5]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|      5|    const int num_remaining_bits = bit_length_ - level;
  327|      5|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|      5|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|      5|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|      5|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|      5|    uint32_t number = 0;
  334|      5|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|      5|    uint32_t first_half = num_remaining_points / 2;
  337|      5|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 4]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|      4|    first_half -= number;
  342|      4|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|      4|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 4, False: 0]
  ------------------
  345|      4|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 0, False: 4]
  ------------------
  346|      0|        std::swap(first_half, second_half);
  347|      0|      }
  348|      4|    }
  349|       |
  350|      4|    levels_stack_[stack_pos][axis] += 1;
  351|      4|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|      4|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 4, False: 0]
  ------------------
  353|      4|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|      4|    }
  355|      4|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 4, False: 0]
  ------------------
  356|      4|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|      4|    }
  358|      4|  }
  359|      0|  return true;
  360|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|    123|        : num_remaining_points(num_remaining_points_),
  135|    123|          last_axis(last_axis_),
  136|    123|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|     61|  void DecodeNumber(int nbits, uint32_t *value) {
  128|     61|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|     61|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|      2|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|     15|      : bit_length_(0),
   87|     15|        num_points_(0),
   88|     15|        num_decoded_points_(0),
   89|     15|        dimension_(dimension),
   90|     15|        p_(dimension, 0),
   91|     15|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     15|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     15|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|      5|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      5|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 5]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      5|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 2]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|      2|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 2]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      2|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 2]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      2|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 2]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      2|  num_decoded_points_ = 0;
  202|       |
  203|      2|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 2]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      2|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 1]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|      1|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 0]
  ------------------
  210|      1|    return false;
  211|      1|  }
  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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     79|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     79|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 79]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     79|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 79]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     79|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 79]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     79|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 79]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     79|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 3, False: 76]
  ------------------
  199|      3|    return false;
  200|      3|  }
  201|     76|  num_decoded_points_ = 0;
  202|       |
  203|     76|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 72]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     72|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 72]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     72|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 71]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     71|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 70]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     70|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 30, False: 40]
  ------------------
  217|     30|    return false;
  218|     30|  }
  219|       |
  220|     40|  numbers_decoder_.EndDecoding();
  221|     40|  remaining_bits_decoder_.EndDecoding();
  222|     40|  axis_decoder_.EndDecoding();
  223|     40|  half_decoder_.EndDecoding();
  224|       |
  225|     40|  return true;
  226|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     70|    uint32_t num_points, OutputIteratorT &oit) {
  254|     70|  typedef DecodingStatus Status;
  255|     70|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     70|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     70|  DecodingStatus init_status(num_points, 0, 0);
  258|     70|  std::stack<Status> status_stack;
  259|     70|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.42M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.42M, False: 40]
  ------------------
  263|  1.42M|    const DecodingStatus status = status_stack.top();
  264|  1.42M|    status_stack.pop();
  265|       |
  266|  1.42M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.42M|    const uint32_t last_axis = status.last_axis;
  268|  1.42M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.42M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.42M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.42M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.42M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.42M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.42M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.42M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.42M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.42M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 632k, False: 790k]
  ------------------
  285|  58.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 57.5M, False: 632k]
  ------------------
  286|  57.5M|        *oit = old_base;
  287|  57.5M|        ++oit;
  288|  57.5M|        ++num_decoded_points_;
  289|  57.5M|      }
  290|   632k|      continue;
  291|   632k|    }
  292|       |
  293|   790k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   790k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 52.1k, False: 738k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  52.1k|      axes_[0] = axis;
  300|  87.3k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 35.2k, False: 52.1k]
  ------------------
  301|  35.2k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  35.2k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 11.1k, False: 24.0k]
  |  |  ------------------
  ------------------
  302|  35.2k|      }
  303|   132k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 80.2k, False: 52.0k]
  ------------------
  304|   208k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 128k, False: 80.2k]
  ------------------
  305|   128k|          p_[axes_[j]] = 0;
  306|   128k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   128k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 110k, False: 17.6k]
  ------------------
  308|   110k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 26, False: 110k]
  ------------------
  309|   110k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     26|              return false;
  311|     26|            }
  312|   110k|          }
  313|   128k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   128k|        }
  315|  80.2k|        *oit = p_;
  316|  80.2k|        ++oit;
  317|  80.2k|        ++num_decoded_points_;
  318|  80.2k|      }
  319|  52.0k|      continue;
  320|  52.1k|    }
  321|       |
  322|   738k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 738k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   738k|    const int num_remaining_bits = bit_length_ - level;
  327|   738k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   738k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   738k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   738k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   738k|    uint32_t number = 0;
  334|   738k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   738k|    uint32_t first_half = num_remaining_points / 2;
  337|   738k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 4, False: 738k]
  ------------------
  338|       |      // Invalid |number|.
  339|      4|      return false;
  340|      4|    }
  341|   738k|    first_half -= number;
  342|   738k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   738k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 701k, False: 36.8k]
  ------------------
  345|   701k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 667k, False: 33.7k]
  ------------------
  346|   667k|        std::swap(first_half, second_half);
  347|   667k|      }
  348|   701k|    }
  349|       |
  350|   738k|    levels_stack_[stack_pos][axis] += 1;
  351|   738k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   738k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 725k, False: 12.9k]
  ------------------
  353|   725k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   725k|    }
  355|   738k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 697k, False: 40.2k]
  ------------------
  356|   697k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   697k|    }
  358|   738k|  }
  359|     40|  return true;
  360|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  1.42M|        : num_remaining_points(num_remaining_points_),
  135|  1.42M|          last_axis(last_axis_),
  136|  1.42M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|   738k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   738k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   738k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     40|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|     90|      : bit_length_(0),
   87|     90|        num_points_(0),
   88|     90|        num_decoded_points_(0),
   89|     90|        dimension_(dimension),
   90|     90|        p_(dimension, 0),
   91|     90|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     90|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     90|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     72|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     72|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 72]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     72|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 71]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     71|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 71]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     71|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 71]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     71|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 71]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     71|  num_decoded_points_ = 0;
  202|       |
  203|     71|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 66]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     66|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 62]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     62|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 59]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     59|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 58]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     58|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 21, False: 37]
  ------------------
  217|     21|    return false;
  218|     21|  }
  219|       |
  220|     37|  numbers_decoder_.EndDecoding();
  221|     37|  remaining_bits_decoder_.EndDecoding();
  222|     37|  axis_decoder_.EndDecoding();
  223|     37|  half_decoder_.EndDecoding();
  224|       |
  225|     37|  return true;
  226|     58|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     58|    uint32_t num_points, OutputIteratorT &oit) {
  254|     58|  typedef DecodingStatus Status;
  255|     58|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     58|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     58|  DecodingStatus init_status(num_points, 0, 0);
  258|     58|  std::stack<Status> status_stack;
  259|     58|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.11M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.11M, False: 37]
  ------------------
  263|  2.11M|    const DecodingStatus status = status_stack.top();
  264|  2.11M|    status_stack.pop();
  265|       |
  266|  2.11M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.11M|    const uint32_t last_axis = status.last_axis;
  268|  2.11M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.11M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.11M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.11M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.11M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.11M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.11M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.11M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.11M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.11M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 926k, False: 1.19M]
  ------------------
  285|  81.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 80.6M, False: 926k]
  ------------------
  286|  80.6M|        *oit = old_base;
  287|  80.6M|        ++oit;
  288|  80.6M|        ++num_decoded_points_;
  289|  80.6M|      }
  290|   926k|      continue;
  291|   926k|    }
  292|       |
  293|  1.19M|    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.19M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 31.3k, False: 1.15M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  31.3k|      axes_[0] = axis;
  300|   171k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 139k, False: 31.3k]
  ------------------
  301|   139k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   139k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 10.0k, False: 129k]
  |  |  ------------------
  ------------------
  302|   139k|      }
  303|  77.7k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 46.4k, False: 31.3k]
  ------------------
  304|   329k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 282k, False: 46.3k]
  ------------------
  305|   282k|          p_[axes_[j]] = 0;
  306|   282k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   282k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 72.5k, False: 210k]
  ------------------
  308|  72.5k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 21, False: 72.4k]
  ------------------
  309|  72.5k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     21|              return false;
  311|     21|            }
  312|  72.5k|          }
  313|   282k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   282k|        }
  315|  46.3k|        *oit = p_;
  316|  46.3k|        ++oit;
  317|  46.3k|        ++num_decoded_points_;
  318|  46.3k|      }
  319|  31.3k|      continue;
  320|  31.3k|    }
  321|       |
  322|  1.15M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.15M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.15M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.15M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.15M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.15M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.15M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.15M|    uint32_t number = 0;
  334|  1.15M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.15M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.15M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 0, False: 1.15M]
  ------------------
  338|       |      // Invalid |number|.
  339|      0|      return false;
  340|      0|    }
  341|  1.15M|    first_half -= number;
  342|  1.15M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.15M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.13M, False: 21.4k]
  ------------------
  345|  1.13M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.07M, False: 59.5k]
  ------------------
  346|  1.07M|        std::swap(first_half, second_half);
  347|  1.07M|      }
  348|  1.13M|    }
  349|       |
  350|  1.15M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.15M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.15M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.11M, False: 45.0k]
  ------------------
  353|  1.11M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.11M|    }
  355|  1.15M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.00M, False: 156k]
  ------------------
  356|  1.00M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.00M|    }
  358|  1.15M|  }
  359|     37|  return true;
  360|     58|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.11M|        : num_remaining_points(num_remaining_points_),
  135|  2.11M|          last_axis(last_axis_),
  136|  2.11M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.11M|    uint32_t last_axis) {
  232|  2.11M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.11M, Folded]
  ------------------
  233|  2.11M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.11M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 501k, False: 1.61M]
  |  |  ------------------
  ------------------
  234|  2.11M|  }
  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.11M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.15M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.15M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.15M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     37|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     65|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     65|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 65]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     65|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 65]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     65|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 65]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     65|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 8, False: 57]
  ------------------
  196|      8|    return true;
  197|      8|  }
  198|     57|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 55]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     55|  num_decoded_points_ = 0;
  202|       |
  203|     55|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 53]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     53|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 53]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     53|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 52]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     52|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 50]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     50|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 22, False: 28]
  ------------------
  217|     22|    return false;
  218|     22|  }
  219|       |
  220|     28|  numbers_decoder_.EndDecoding();
  221|     28|  remaining_bits_decoder_.EndDecoding();
  222|     28|  axis_decoder_.EndDecoding();
  223|     28|  half_decoder_.EndDecoding();
  224|       |
  225|     28|  return true;
  226|     50|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     50|    uint32_t num_points, OutputIteratorT &oit) {
  254|     50|  typedef DecodingStatus Status;
  255|     50|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     50|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     50|  DecodingStatus init_status(num_points, 0, 0);
  258|     50|  std::stack<Status> status_stack;
  259|     50|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   212k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 212k, False: 28]
  ------------------
  263|   212k|    const DecodingStatus status = status_stack.top();
  264|   212k|    status_stack.pop();
  265|       |
  266|   212k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   212k|    const uint32_t last_axis = status.last_axis;
  268|   212k|    const uint32_t stack_pos = status.stack_pos;
  269|   212k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   212k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   212k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 212k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   212k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   212k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 5, False: 212k]
  ------------------
  278|      5|      return false;
  279|      5|    }
  280|       |
  281|   212k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   212k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 151, False: 211k]
  ------------------
  285|  1.76M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.76M, False: 151]
  ------------------
  286|  1.76M|        *oit = old_base;
  287|  1.76M|        ++oit;
  288|  1.76M|        ++num_decoded_points_;
  289|  1.76M|      }
  290|    151|      continue;
  291|    151|    }
  292|       |
  293|   211k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   211k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 126, False: 211k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    126|      axes_[0] = axis;
  300|  10.3k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 10.2k, False: 126]
  ------------------
  301|  10.2k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  10.2k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 121, False: 10.1k]
  |  |  ------------------
  ------------------
  302|  10.2k|      }
  303|    280|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 164, False: 116]
  ------------------
  304|  11.9k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 11.7k, False: 154]
  ------------------
  305|  11.7k|          p_[axes_[j]] = 0;
  306|  11.7k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  11.7k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 11.4k, False: 326]
  ------------------
  308|  11.4k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 10, False: 11.4k]
  ------------------
  309|  11.4k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     10|              return false;
  311|     10|            }
  312|  11.4k|          }
  313|  11.7k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  11.7k|        }
  315|    154|        *oit = p_;
  316|    154|        ++oit;
  317|    154|        ++num_decoded_points_;
  318|    154|      }
  319|    116|      continue;
  320|    126|    }
  321|       |
  322|   211k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 211k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   211k|    const int num_remaining_bits = bit_length_ - level;
  327|   211k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   211k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   211k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   211k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   211k|    uint32_t number = 0;
  334|   211k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   211k|    uint32_t first_half = num_remaining_points / 2;
  337|   211k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 7, False: 211k]
  ------------------
  338|       |      // Invalid |number|.
  339|      7|      return false;
  340|      7|    }
  341|   211k|    first_half -= number;
  342|   211k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   211k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 211k, False: 19]
  ------------------
  345|   211k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 182k, False: 29.1k]
  ------------------
  346|   182k|        std::swap(first_half, second_half);
  347|   182k|      }
  348|   211k|    }
  349|       |
  350|   211k|    levels_stack_[stack_pos][axis] += 1;
  351|   211k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   211k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 182k, False: 29.0k]
  ------------------
  353|   182k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   182k|    }
  355|   211k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 29.3k, False: 182k]
  ------------------
  356|  29.3k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  29.3k|    }
  358|   211k|  }
  359|     28|  return true;
  360|     50|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   212k|        : num_remaining_points(num_remaining_points_),
  135|   212k|          last_axis(last_axis_),
  136|   212k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   211k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   211k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   211k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     36|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|     65|      : bit_length_(0),
   87|     65|        num_points_(0),
   88|     65|        num_decoded_points_(0),
   89|     65|        dimension_(dimension),
   90|     65|        p_(dimension, 0),
   91|     65|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     65|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     65|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      6|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      6|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|     19|      : bit_length_(0),
   87|     19|        num_points_(0),
   88|     19|        num_decoded_points_(0),
   89|     19|        dimension_(dimension),
   90|     19|        p_(dimension, 0),
   91|     19|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     19|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     19|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     17|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     17|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     17|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      8|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      8|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      8|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|      6|      : bit_length_(0),
   87|      6|        num_points_(0),
   88|      6|        num_decoded_points_(0),
   89|      6|        dimension_(dimension),
   90|      6|        p_(dimension, 0),
   91|      6|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|      6|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|      6|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|     72|      : bit_length_(0),
   87|     72|        num_points_(0),
   88|     72|        num_decoded_points_(0),
   89|     72|        dimension_(dimension),
   90|     72|        p_(dimension, 0),
   91|     72|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     72|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     72|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.20k|    uint32_t last_axis) {
  232|  3.20k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 3.20k, Folded]
  ------------------
  233|  3.20k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.20k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 807, False: 2.39k]
  |  |  ------------------
  ------------------
  234|  3.20k|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  3.20k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|     87|    uint32_t last_axis) {
  232|     87|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 87, Folded]
  ------------------
  233|     87|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|     87|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 37, False: 50]
  |  |  ------------------
  ------------------
  234|     87|  }
  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|     87|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.42M|    uint32_t last_axis) {
  232|  1.42M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.42M, Folded]
  ------------------
  233|  1.42M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.42M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.26M, False: 157k]
  |  |  ------------------
  ------------------
  234|  1.42M|  }
  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.42M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   212k|    uint32_t last_axis) {
  232|   212k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 212k]
  ------------------
  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|   212k|  uint32_t best_axis = 0;
  237|   212k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 211k, False: 149]
  ------------------
  238|  33.3M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 33.1M, False: 211k]
  ------------------
  239|  33.1M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 210k, False: 32.9M]
  ------------------
  240|   210k|        best_axis = axis;
  241|   210k|      }
  242|  33.1M|    }
  243|   211k|  } else {
  244|    149|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|    149|  }
  246|       |
  247|   212k|  return best_axis;
  248|   212k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      3|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      3|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      3|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      3|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      3|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 3]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      3|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 3]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      3|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 3]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      3|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 2]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|      2|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 2]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      2|  num_decoded_points_ = 0;
  202|       |
  203|      2|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 2]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      2|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 2]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      2|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 2]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      2|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 2]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      2|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 2, False: 0]
  ------------------
  217|      2|    return false;
  218|      2|  }
  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|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|      2|    uint32_t num_points, OutputIteratorT &oit) {
  254|      2|  typedef DecodingStatus Status;
  255|      2|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      2|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      2|  DecodingStatus init_status(num_points, 0, 0);
  258|      2|  std::stack<Status> status_stack;
  259|      2|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|     82|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 82, False: 0]
  ------------------
  263|     82|    const DecodingStatus status = status_stack.top();
  264|     82|    status_stack.pop();
  265|       |
  266|     82|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|     82|    const uint32_t last_axis = status.last_axis;
  268|     82|    const uint32_t stack_pos = status.stack_pos;
  269|     82|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|     82|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|     82|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 82]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|     82|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|     82|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 82]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|     82|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|     82|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 0, False: 82]
  ------------------
  285|      0|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 0, False: 0]
  ------------------
  286|      0|        *oit = old_base;
  287|      0|        ++oit;
  288|      0|        ++num_decoded_points_;
  289|      0|      }
  290|      0|      continue;
  291|      0|    }
  292|       |
  293|     82|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|     82|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 26, False: 56]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     26|      axes_[0] = axis;
  300|     78|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 52, False: 26]
  ------------------
  301|     52|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|     52|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 12, False: 40]
  |  |  ------------------
  ------------------
  302|     52|      }
  303|     70|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 46, False: 24]
  ------------------
  304|    178|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 134, False: 44]
  ------------------
  305|    134|          p_[axes_[j]] = 0;
  306|    134|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    134|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 134, False: 0]
  ------------------
  308|    134|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 2, False: 132]
  ------------------
  309|    134|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      2|              return false;
  311|      2|            }
  312|    134|          }
  313|    132|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    132|        }
  315|     44|        *oit = p_;
  316|     44|        ++oit;
  317|     44|        ++num_decoded_points_;
  318|     44|      }
  319|     24|      continue;
  320|     26|    }
  321|       |
  322|     56|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 56]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|     56|    const int num_remaining_bits = bit_length_ - level;
  327|     56|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|     56|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|     56|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|     56|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|     56|    uint32_t number = 0;
  334|     56|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|     56|    uint32_t first_half = num_remaining_points / 2;
  337|     56|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 0, False: 56]
  ------------------
  338|       |      // Invalid |number|.
  339|      0|      return false;
  340|      0|    }
  341|     56|    first_half -= number;
  342|     56|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|     56|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 46, False: 10]
  ------------------
  345|     46|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 46, False: 0]
  ------------------
  346|     46|        std::swap(first_half, second_half);
  347|     46|      }
  348|     46|    }
  349|       |
  350|     56|    levels_stack_[stack_pos][axis] += 1;
  351|     56|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|     56|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 56, False: 0]
  ------------------
  353|     56|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|     56|    }
  355|     56|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 56, False: 0]
  ------------------
  356|     56|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|     56|    }
  358|     56|  }
  359|      0|  return true;
  360|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      1|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      1|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      1|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      1|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 1]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      1|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 0]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|      0|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 0]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      0|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 0]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      0|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 0]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      0|  num_decoded_points_ = 0;
  202|       |
  203|      0|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 0]
  ------------------
  204|      0|    return false;
  205|      0|  }
  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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     11|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     11|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     11|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     11|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     11|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 11]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     11|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 11]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     11|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 11]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     11|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 9, False: 2]
  ------------------
  196|      9|    return true;
  197|      9|  }
  198|      2|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 2]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      2|  num_decoded_points_ = 0;
  202|       |
  203|      2|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 0]
  ------------------
  204|      2|    return false;
  205|      2|  }
  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|     15|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|     15|  qinfo_.quantization_bits = 0;
   67|     15|  qinfo_.range = 0;
   68|     15|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|     15|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|     15|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 15]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|     15|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 15]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|     15|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 15]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|     15|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 15]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|     15|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 0, False: 15]
  |  Branch (84:38): [True: 0, False: 0]
  ------------------
   85|      0|    return false;
   86|      0|  }
   87|     15|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 15]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|     15|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 0, False: 15]
  ------------------
   93|      0|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      0|#define DRACO_LOGE printf
  ------------------
   94|      0|               compression_level_);
   95|      0|    return false;
   96|      0|  }
   97|       |
   98|     15|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|     15|      std::back_inserter(*qpoints);
  100|     15|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|     15|                           Converter>
  102|     15|      oit(oit_qpoints);
  103|     15|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 15, False: 0]
  ------------------
  104|     15|    qpoints->reserve(num_points_);
  105|     15|    switch (compression_level_) {
  106|      0|      case 0: {
  ------------------
  |  Branch (106:7): [True: 0, False: 15]
  ------------------
  107|      0|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  109|      0|        break;
  110|      0|      }
  111|      0|      case 1: {
  ------------------
  |  Branch (111:7): [True: 0, False: 15]
  ------------------
  112|      0|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  114|      0|        break;
  115|      0|      }
  116|      3|      case 2: {
  ------------------
  |  Branch (116:7): [True: 3, False: 12]
  ------------------
  117|      3|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|      3|        qpoints_decoder.DecodePoints(buffer, oit);
  119|      3|        break;
  120|      0|      }
  121|      1|      case 3: {
  ------------------
  |  Branch (121:7): [True: 1, False: 14]
  ------------------
  122|      1|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|      1|        qpoints_decoder.DecodePoints(buffer, oit);
  124|      1|        break;
  125|      0|      }
  126|     11|      case 4: {
  ------------------
  |  Branch (126:7): [True: 11, False: 4]
  ------------------
  127|     11|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     11|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     11|        break;
  130|      0|      }
  131|      0|      case 5: {
  ------------------
  |  Branch (131:7): [True: 0, False: 15]
  ------------------
  132|      0|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  134|      0|        break;
  135|      0|      }
  136|      0|      case 6: {
  ------------------
  |  Branch (136:7): [True: 0, False: 15]
  ------------------
  137|      0|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  139|      0|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 15]
  ------------------
  142|      0|        return false;
  143|     15|    }
  144|     15|  }
  145|       |
  146|     15|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 15, False: 0]
  ------------------
  147|     15|    return false;
  148|     15|  }
  149|      0|  return true;
  150|     15|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|     15|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|     44|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|     44|  const Self &operator=(const SourceType &source) {
   56|     44|    *oit_ = Converter()(source);
   57|     44|    return *this;
   58|     44|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|     44|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|     44|    return Point3ui(v[0], v[1], v[2]);
   31|     44|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|     44|  const Self &operator++() {
   46|     44|    ++oit_;
   47|     44|    return *this;
   48|     44|  }

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

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

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

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

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

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

_ZN5draco18MostSignificantBitEj:
   58|  2.11M|inline int MostSignificantBit(uint32_t n) {
   59|  2.11M|#if defined(__GNUC__)
   60|  2.11M|  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|  2.11M|}
_ZN5draco24ConvertSymbolToSignedIntIjEENSt3__111make_signedIT_E4typeES3_:
  112|  3.91M|    IntTypeT val) {
  113|  3.91M|  static_assert(std::is_integral<IntTypeT>::value, "IntTypeT is not integral.");
  114|  3.91M|  typedef typename std::make_signed<IntTypeT>::type SignedType;
  115|  3.91M|  const bool is_positive = !static_cast<bool>(val & 1);
  116|  3.91M|  val >>= 1;
  117|  3.91M|  if (is_positive) {
  ------------------
  |  Branch (117:7): [True: 2.92M, False: 985k]
  ------------------
  118|  2.92M|    return static_cast<SignedType>(val);
  119|  2.92M|  }
  120|   985k|  SignedType ret = static_cast<SignedType>(val);
  121|   985k|  ret = -ret - 1;
  122|   985k|  return ret;
  123|  3.91M|}

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  27.1M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  27.1M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 27.1M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  27.1M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  27.1M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  3.69M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  3.69M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 29, False: 3.69M]
  ------------------
   78|     29|      return false;  // Buffer overflow.
   79|     29|    }
   80|  3.69M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  3.69M|    pos_ += size_to_decode;
   82|  3.69M|    return true;
   83|  3.69M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  9.00k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  1.14k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  10.0k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   118k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|    451|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  27.1M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  66.1k|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|    592|    inline void reset(const void *b, size_t s) {
  131|    592|      bit_offset_ = 0;
  132|    592|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|    592|      bit_buffer_end_ = bit_buffer_ + s;
  134|    592|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|    482|    inline uint64_t BitsDecoded() const {
  138|    482|      return static_cast<uint64_t>(bit_offset_);
  139|    482|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  27.1M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  27.1M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 27.1M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  27.1M|      uint32_t value = 0;
  165|  63.7M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 36.5M, False: 27.1M]
  ------------------
  166|  36.5M|        value |= GetBit() << bit;
  167|  36.5M|      }
  168|  27.1M|      *x = value;
  169|  27.1M|      return true;
  170|  27.1M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  36.5M|    inline int GetBit() {
  176|  36.5M|      const size_t off = bit_offset_;
  177|  36.5M|      const size_t byte_offset = off >> 3;
  178|  36.5M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  36.5M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 35.3M, False: 1.24M]
  ------------------
  180|  35.3M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  35.3M|        bit_offset_ = off + 1;
  182|  35.3M|        return bit;
  183|  35.3M|      }
  184|  1.24M|      return 0;
  185|  36.5M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  8.66M|  bool Decode(T *out_val) {
   69|  8.66M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 188, False: 8.66M]
  ------------------
   70|    188|      return false;
   71|    188|    }
   72|  8.66M|    pos_ += sizeof(T);
   73|  8.66M|    return true;
   74|  8.66M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  8.66M|  bool Peek(T *out_val) {
   88|  8.66M|    const size_t size_to_decode = sizeof(T);
   89|  8.66M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 188, False: 8.66M]
  ------------------
   90|    188|      return false;  // Buffer overflow.
   91|    188|    }
   92|  8.66M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  8.66M|    return true;
   94|  8.66M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  1.42k|  bool Decode(T *out_val) {
   69|  1.42k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 1.42k]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|  1.42k|    pos_ += sizeof(T);
   73|  1.42k|    return true;
   74|  1.42k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  1.42k|  bool Peek(T *out_val) {
   88|  1.42k|    const size_t size_to_decode = sizeof(T);
   89|  1.42k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 1.42k]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|  1.42k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.42k|    return true;
   94|  1.42k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   268k|  bool Decode(T *out_val) {
   69|   268k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 23, False: 268k]
  ------------------
   70|     23|      return false;
   71|     23|    }
   72|   268k|    pos_ += sizeof(T);
   73|   268k|    return true;
   74|   268k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   268k|  bool Peek(T *out_val) {
   88|   268k|    const size_t size_to_decode = sizeof(T);
   89|   268k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 23, False: 268k]
  ------------------
   90|     23|      return false;  // Buffer overflow.
   91|     23|    }
   92|   268k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   268k|    return true;
   94|   268k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  2.30k|  bool Decode(T *out_val) {
   69|  2.30k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 2.30k]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|  2.30k|    pos_ += sizeof(T);
   73|  2.30k|    return true;
   74|  2.30k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  2.30k|  bool Peek(T *out_val) {
   88|  2.30k|    const size_t size_to_decode = sizeof(T);
   89|  2.30k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 2.30k]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|  2.30k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.30k|    return true;
   94|  2.30k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   259k|  bool Decode(T *out_val) {
   69|   259k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 15, False: 259k]
  ------------------
   70|     15|      return false;
   71|     15|    }
   72|   259k|    pos_ += sizeof(T);
   73|   259k|    return true;
   74|   259k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   259k|  bool Peek(T *out_val) {
   88|   259k|    const size_t size_to_decode = sizeof(T);
   89|   259k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 15, False: 259k]
  ------------------
   90|     15|      return false;  // Buffer overflow.
   91|     15|    }
   92|   259k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   259k|    return true;
   94|   259k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  80.8k|  bool Decode(T *out_val) {
   69|  80.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 80.8k]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|  80.8k|    pos_ += sizeof(T);
   73|  80.8k|    return true;
   74|  80.8k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  80.8k|  bool Peek(T *out_val) {
   88|  80.8k|    const size_t size_to_decode = sizeof(T);
   89|  80.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 80.8k]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|  80.8k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  80.8k|    return true;
   94|  80.8k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|    143|  bool Decode(T *out_val) {
   69|    143|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 143]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|    143|    pos_ += sizeof(T);
   73|    143|    return true;
   74|    143|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|    143|  bool Peek(T *out_val) {
   88|    143|    const size_t size_to_decode = sizeof(T);
   89|    143|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 143]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|    143|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    143|    return true;
   94|    143|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|     58|  bool Decode(T *out_val) {
   69|     58|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 58]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|     58|    pos_ += sizeof(T);
   73|     58|    return true;
   74|     58|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|     58|  bool Peek(T *out_val) {
   88|     58|    const size_t size_to_decode = sizeof(T);
   89|     58|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 58]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|     58|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|     58|    return true;
   94|     58|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   158M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   156M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  1.02M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  1.02M|    return value_ >= val;
  100|  1.02M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|  32.5M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|   482M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  2.57M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  16.7M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  16.7M|    value_ = i.value_;
  153|  16.7M|    return *this;
  154|  16.7M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|  3.13M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  3.13M|    value_ = i.value_;
  153|  3.13M|    return *this;
  154|  3.13M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  2.57M|  inline ThisIndexType &operator++() {
  103|  2.57M|    ++value_;
  104|  2.57M|    return *this;
  105|  2.57M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|   353M|  constexpr bool operator==(const IndexType &i) const {
   76|   353M|    return value_ == i.value_;
   77|   353M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   105M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  24.5M|  constexpr bool operator==(const IndexType &i) const {
   76|  24.5M|    return value_ == i.value_;
   77|  24.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|  46.2M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|  46.2M|    return ThisIndexType(value_ - val);
  133|  46.2M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   120M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   120M|    return ThisIndexType(value_ + val);
  127|   120M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|   892k|  constexpr bool operator==(const IndexType &i) const {
   76|   892k|    return value_ == i.value_;
   77|   892k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|  38.2M|  constexpr bool operator!=(const IndexType &i) const {
   82|  38.2M|    return value_ != i.value_;
   83|  38.2M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|  73.8M|  constexpr bool operator!=(const IndexType &i) const {
   82|  73.8M|    return value_ != i.value_;
   83|  73.8M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|  87.5M|  inline ThisIndexType &operator++() {
  103|  87.5M|    ++value_;
  104|  87.5M|    return *this;
  105|  87.5M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|  80.2M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  80.2M|    value_ = i.value_;
  153|  80.2M|    return *this;
  154|  80.2M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   157M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   157M|    value_ = i.value_;
  153|   157M|    return *this;
  154|   157M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  4.64M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  4.64M|    return value_ >= val;
  100|  4.64M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  1.03M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   196M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  2.12G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|  26.0M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  1.41G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|  15.5M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  8.62M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  8.62M|    return ThisIndexType(value_ + val);
  127|  8.62M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|  36.4M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  3.06M|  constexpr bool operator<(const IndexType &i) const {
   88|  3.06M|    return value_ < i.value_;
   89|  3.06M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   169M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  3.44M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  4.90M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   154M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   201M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|   698k|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   698k|    value_ = i.value_;
  153|   698k|    return *this;
  154|   698k|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  1.03M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  1.03M|    value_ += val;
  141|  1.03M|    return *this;
  142|  1.03M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  3.37M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  3.37M|    value_ = val;
  157|  3.37M|    return *this;
  158|  3.37M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  66.7k|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  1.84M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  1.84M|  inline ThisIndexType &operator++() {
  103|  1.84M|    ++value_;
  104|  1.84M|    return *this;
  105|  1.84M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  3.68M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    251|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   143M|  inline ThisIndexType &operator++() {
  103|   143M|    ++value_;
  104|   143M|    return *this;
  105|   143M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|    238|  inline ThisIndexType &operator++() {
  103|    238|    ++value_;
  104|    238|    return *this;
  105|    238|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   140M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   140M|    return value_ >= val;
  100|   140M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  7.58M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  7.58M|    return vector_[index.value()];
   75|  7.58M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  3.68M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  1.44k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  4.08k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  8.33M|  inline reference operator[](const IndexTypeT &index) {
   71|  8.33M|    return vector_[index.value()];
   72|  8.33M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   104k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  2.04M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|    278|  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|  1.02M|  inline reference operator[](const IndexTypeT &index) {
   71|  1.02M|    return vector_[index.value()];
   72|  1.02M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  1.92M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  1.92M|    return vector_[index.value()];
   75|  1.92M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|  28.4M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  1.08M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|  65.0M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  65.0M|    return vector_[index.value()];
   75|  65.0M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  86.6M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  86.6M|    return vector_[index.value()];
   75|  86.6M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|  70.2M|  inline reference operator[](const IndexTypeT &index) {
   71|  70.2M|    return vector_[index.value()];
   72|  70.2M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  14.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  14.3M|    return vector_[index.value()];
   75|  14.3M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|  55.1M|  inline reference operator[](const IndexTypeT &index) {
   71|  55.1M|    return vector_[index.value()];
   72|  55.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  17.3M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|  37.0M|  inline reference operator[](const IndexTypeT &index) {
   71|  37.0M|    return vector_[index.value()];
   72|  37.0M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|    107|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|  68.3k|  inline reference operator[](const IndexTypeT &index) {
   71|  68.3k|    return vector_[index.value()];
   72|  68.3k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  4.98k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  54.9k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  4.85k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|    505|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|    505|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|    505|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|    505|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  1.25k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  1.25k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  1.25k|    vector_.swap(arg.vector_);
   57|  1.25k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  1.25k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  1.25k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  1.25k|    vector_.swap(arg.vector_);
   57|  1.25k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|    505|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|    505|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|    505|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|    845|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  7.31k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  11.6k|int32_t DataTypeLength(DataType dt) {
   20|  11.6k|  switch (dt) {
   21|  5.92k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 5.92k, False: 5.76k]
  ------------------
   22|  6.17k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 244, False: 11.4k]
  ------------------
   23|  6.17k|      return 1;
   24|  1.53k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 1.53k, False: 10.1k]
  ------------------
   25|  1.58k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 51, False: 11.6k]
  ------------------
   26|  1.58k|      return 2;
   27|  3.23k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 3.23k, False: 8.45k]
  ------------------
   28|  3.44k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 214, False: 11.4k]
  ------------------
   29|  3.44k|      return 4;
   30|      2|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 2, False: 11.6k]
  ------------------
   31|     50|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 48, False: 11.6k]
  ------------------
   32|     50|      return 8;
   33|    417|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 417, False: 11.2k]
  ------------------
   34|    417|      return 4;
   35|      0|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 0, False: 11.6k]
  ------------------
   36|      0|      return 8;
   37|     18|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 18, False: 11.6k]
  ------------------
   38|     18|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 11.6k]
  ------------------
   40|      0|      return -1;
   41|  11.6k|  }
   42|  11.6k|}

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

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

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

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

_ZNK5draco11Dequantizer15DequantizeFloatEi:
   71|    159|  inline float DequantizeFloat(int32_t val) const {
   72|    159|    return static_cast<float>(val) * delta_;
   73|    159|  }

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    301|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    845|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  1.14k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  1.14k|  bool ok() const { return status_.ok(); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  1.09k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  1.14k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|     49|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    301|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    301|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    845|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    845|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   245k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   245k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 245k, Folded]
  ------------------
   65|   245k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 74, False: 244k]
  ------------------
   66|     74|      return false;
   67|     74|    }
   68|   245k|  } 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|   244k|  return true;
   77|   245k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  86.5k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  86.5k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  86.5k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 19, False: 86.5k]
  ------------------
   33|     19|    return false;
   34|     19|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  86.5k|  uint8_t in;
   39|  86.5k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 32, False: 86.5k]
  ------------------
   40|     32|    return false;
   41|     32|  }
   42|  86.5k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 6.48k, False: 80.0k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  6.48k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 95, False: 6.39k]
  ------------------
   45|     95|      return false;
   46|     95|    }
   47|       |    // Append decoded info from this byte.
   48|  6.39k|    *out_val <<= 7;
   49|  6.39k|    *out_val |= in & ((1 << 7) - 1);
   50|  80.0k|  } else {
   51|       |    // Last byte reached
   52|  80.0k|    *out_val = in;
   53|  80.0k|  }
   54|  86.4k|  return true;
   55|  86.5k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  1.07k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.07k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.07k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 1.07k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.07k|  uint8_t in;
   39|  1.07k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 1.07k]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|  1.07k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 218, False: 858]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    218|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 5, False: 213]
  ------------------
   45|      5|      return false;
   46|      5|    }
   47|       |    // Append decoded info from this byte.
   48|    213|    *out_val <<= 7;
   49|    213|    *out_val |= in & ((1 << 7) - 1);
   50|    858|  } else {
   51|       |    // Last byte reached
   52|    858|    *out_val = in;
   53|    858|  }
   54|  1.07k|  return true;
   55|  1.07k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|    411|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|    411|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 411, Folded]
  ------------------
   65|    411|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 411]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|    411|  } 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|    411|  return true;
   77|    411|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|    334|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    334|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    334|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 334]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    334|  uint8_t in;
   39|    334|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 334]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    334|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 32, False: 302]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     32|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 32]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     32|    *out_val <<= 7;
   49|     32|    *out_val |= in & ((1 << 7) - 1);
   50|    302|  } else {
   51|       |    // Last byte reached
   52|    302|    *out_val = in;
   53|    302|  }
   54|    334|  return true;
   55|    334|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   147k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   147k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   147k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 147k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   147k|  uint8_t in;
   39|   147k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 5, False: 147k]
  ------------------
   40|      5|    return false;
   41|      5|  }
   42|   147k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 302, False: 147k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    302|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 272]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|    272|    *out_val <<= 7;
   49|    272|    *out_val |= in & ((1 << 7) - 1);
   50|   147k|  } else {
   51|       |    // Last byte reached
   52|   147k|    *out_val = in;
   53|   147k|  }
   54|   147k|  return true;
   55|   147k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  2.52k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.52k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 2.52k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  2.52k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  2.52k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  2.52k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 38, False: 2.48k]
  ------------------
   72|     38|      return false;
   73|     38|    }
   74|  2.48k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  2.48k|  }
   76|  2.48k|  return true;
   77|  2.52k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.93k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.93k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.93k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 18, False: 2.91k]
  ------------------
   33|     18|    return false;
   34|     18|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.91k|  uint8_t in;
   39|  2.91k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 20, False: 2.89k]
  ------------------
   40|     20|    return false;
   41|     20|  }
   42|  2.89k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 415, False: 2.48k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    415|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 90, False: 325]
  ------------------
   45|     90|      return false;
   46|     90|    }
   47|       |    // Append decoded info from this byte.
   48|    325|    *out_val <<= 7;
   49|    325|    *out_val |= in & ((1 << 7) - 1);
   50|  2.48k|  } else {
   51|       |    // Last byte reached
   52|  2.48k|    *out_val = in;
   53|  2.48k|  }
   54|  2.80k|  return true;
   55|  2.89k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    285|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    285|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    285|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 282]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    282|  uint8_t in;
   39|    282|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 282]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    282|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 34, False: 248]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     34|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 15, False: 19]
  ------------------
   45|     15|      return false;
   46|     15|    }
   47|       |    // Append decoded info from this byte.
   48|     19|    *out_val <<= 7;
   49|     19|    *out_val |= in & ((1 << 7) - 1);
   50|    248|  } else {
   51|       |    // Last byte reached
   52|    248|    *out_val = in;
   53|    248|  }
   54|    267|  return true;
   55|    282|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.70k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.70k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.70k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 8.70k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.70k|  uint8_t in;
   39|  8.70k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 8.70k]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|  8.70k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 258, False: 8.44k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    258|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 15, False: 243]
  ------------------
   45|     15|      return false;
   46|     15|    }
   47|       |    // Append decoded info from this byte.
   48|    243|    *out_val <<= 7;
   49|    243|    *out_val |= in & ((1 << 7) - 1);
   50|  8.44k|  } else {
   51|       |    // Last byte reached
   52|  8.44k|    *out_val = in;
   53|  8.44k|  }
   54|  8.68k|  return true;
   55|  8.70k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    494|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    494|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    494|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 494]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    494|  uint8_t in;
   39|    494|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 494]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    494|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 169, False: 325]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    169|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 169]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    169|    *out_val <<= 7;
   49|    169|    *out_val |= in & ((1 << 7) - 1);
   50|    325|  } else {
   51|       |    // Last byte reached
   52|    325|    *out_val = in;
   53|    325|  }
   54|    494|  return true;
   55|    494|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|    355|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    355|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    355|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 355]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    355|  uint8_t in;
   39|    355|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 355]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    355|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 246, False: 109]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    246|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 246]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    246|    *out_val <<= 7;
   49|    246|    *out_val |= in & ((1 << 7) - 1);
   50|    246|  } else {
   51|       |    // Last byte reached
   52|    109|    *out_val = in;
   53|    109|  }
   54|    355|  return true;
   55|    355|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.40k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.40k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.40k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 8.39k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.39k|  uint8_t in;
   39|  8.39k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 8.39k]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|  8.39k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 843, False: 7.55k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    843|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 25, False: 818]
  ------------------
   45|     25|      return false;
   46|     25|    }
   47|       |    // Append decoded info from this byte.
   48|    818|    *out_val <<= 7;
   49|    818|    *out_val |= in & ((1 << 7) - 1);
   50|  7.55k|  } else {
   51|       |    // Last byte reached
   52|  7.55k|    *out_val = in;
   53|  7.55k|  }
   54|  8.37k|  return true;
   55|  8.39k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|    576|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|    768|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|     64|  Self operator-(const Self &o) const {
  138|     64|    Self ret;
  139|    256|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 192, False: 64]
  ------------------
  140|    192|      ret[i] = (*this)[i] - o[i];
  141|    192|    }
  142|     64|    return ret;
  143|     64|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|    160|  VectorD() {
   41|    640|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 480, False: 160]
  ------------------
   42|    480|      (*this)[i] = Scalar(0);
   43|    480|    }
   44|    160|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|    132|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|  43.6M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  3.57M|  Self operator-(const Self &o) const {
  138|  3.57M|    Self ret;
  139|  14.2M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 10.7M, False: 3.57M]
  ------------------
  140|  10.7M|      ret[i] = (*this)[i] - o[i];
  141|  10.7M|    }
  142|  3.57M|    return ret;
  143|  3.57M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  1.78M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  1.78M|  static_assert(std::is_signed<ScalarT>::value,
  321|  1.78M|                "ScalarT must be a signed type. ");
  322|  1.78M|  VectorD<ScalarT, 3> r;
  323|  1.78M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  1.78M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  1.78M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  1.78M|  return r;
  327|  1.78M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  1.78M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  1.78M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|   325k|  Scalar AbsSum() const {
  238|   325k|    Scalar result(0);
  239|  1.28M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 974k, False: 311k]
  ------------------
  240|   974k|      Scalar next_value = std::abs(v_[i]);
  241|   974k|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 14.3k, False: 960k]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  14.3k|        return std::numeric_limits<Scalar>::max();
  244|  14.3k|      }
  245|   960k|      result += next_value;
  246|   960k|    }
  247|   311k|    return result;
  248|   325k|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   251k|  Self operator/(const Scalar &o) const {
  183|   251k|    Self ret;
  184|  1.00M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 753k, False: 251k]
  ------------------
  185|   753k|      ret[i] = (*this)[i] / o;
  186|   753k|    }
  187|   251k|    return ret;
  188|   251k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|  51.2M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  1.86M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|   977k|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|   310k|  Self operator-() const {
  121|   310k|    Self ret;
  122|  1.24M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 930k, False: 310k]
  ------------------
  123|   930k|      ret[i] = -(*this)[i];
  124|   930k|    }
  125|   310k|    return ret;
  126|   310k|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|   930k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   145k|  Self operator-(const Self &o) const {
  138|   145k|    Self ret;
  139|   435k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 290k, False: 145k]
  ------------------
  140|   290k|      ret[i] = (*this)[i] - o[i];
  141|   290k|    }
  142|   145k|    return ret;
  143|   145k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  1.74M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  2.61M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  5.97M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|   290k|  Self operator+(const Self &o) const {
  130|   290k|    Self ret;
  131|   871k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 581k, False: 290k]
  ------------------
  132|   581k|      ret[i] = (*this)[i] + o[i];
  133|   581k|    }
  134|   290k|    return ret;
  135|   290k|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  5.53M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   151k|  Self operator-(const Self &o) const {
  138|   151k|    Self ret;
  139|   453k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 302k, False: 151k]
  ------------------
  140|   302k|      ret[i] = (*this)[i] - o[i];
  141|   302k|    }
  142|   151k|    return ret;
  143|   151k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   151k|  Self operator+(const Self &o) const {
  130|   151k|    Self ret;
  131|   453k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 302k, False: 151k]
  ------------------
  132|   302k|      ret[i] = (*this)[i] + o[i];
  133|   302k|    }
  134|   151k|    return ret;
  135|   151k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|    100|  bool operator==(const Self &o) const {
  207|    242|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 174, False: 68]
  ------------------
  208|    174|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 32, False: 142]
  ------------------
  209|     32|        return false;
  210|     32|      }
  211|    174|    }
  212|     68|    return true;
  213|    100|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  1.21k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|     32|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|     32|  Scalar Dot(const Self &o) const {
  251|     32|    Scalar ret(0);
  252|    128|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 96, False: 32]
  ------------------
  253|     96|      ret += (*this)[i] * o[i];
  254|     96|    }
  255|     32|    return ret;
  256|     32|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|     32|  Self operator-(const Self &o) const {
  138|     32|    Self ret;
  139|     96|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 64, False: 32]
  ------------------
  140|     64|      ret[i] = (*this)[i] - o[i];
  141|     64|    }
  142|     32|    return ret;
  143|     32|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|     64|  VectorD() {
   41|    192|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 128, False: 64]
  ------------------
   42|    128|      (*this)[i] = Scalar(0);
   43|    128|    }
   44|     64|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|    230|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|    230|    DRACO_DCHECK_EQ(dimension, 2);
   54|    230|    v_[0] = c0;
   55|    230|    v_[1] = c1;
   56|    230|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|    252|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|    565|  bool operator==(const Self &o) const {
  207|    739|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 685, False: 54]
  ------------------
  208|    685|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 511, False: 174]
  ------------------
  209|    511|        return false;
  210|    511|      }
  211|    685|    }
  212|     54|    return true;
  213|    565|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  13.8k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  9.83M|  VectorD() {
   41|  39.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 29.5M, False: 9.83M]
  ------------------
   42|  29.5M|      (*this)[i] = Scalar(0);
   43|  29.5M|    }
   44|  9.83M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|    985|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  1.46k|  Scalar Dot(const Self &o) const {
  251|  1.46k|    Scalar ret(0);
  252|  5.86k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 4.39k, False: 1.46k]
  ------------------
  253|  4.39k|      ret += (*this)[i] * o[i];
  254|  4.39k|    }
  255|  1.46k|    return ret;
  256|  1.46k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|    480|  Self operator-(const Self &o) const {
  138|    480|    Self ret;
  139|  1.44k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 960, False: 480]
  ------------------
  140|    960|      ret[i] = (*this)[i] - o[i];
  141|    960|    }
  142|    480|    return ret;
  143|    480|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  1.42k|  Self operator*(const Scalar &o) const {
  175|  1.42k|    Self ret;
  176|  4.26k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 2.84k, False: 1.42k]
  ------------------
  177|  2.84k|      ret[i] = (*this)[i] * o;
  178|  2.84k|    }
  179|  1.42k|    return ret;
  180|  1.42k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|    474|  Self operator+(const Self &o) const {
  130|    474|    Self ret;
  131|  1.42k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 948, False: 474]
  ------------------
  132|    948|      ret[i] = (*this)[i] + o[i];
  133|    948|    }
  134|    474|    return ret;
  135|    474|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|    474|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|    474|  return v * o;
  294|    474|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|    474|  Self operator+(const Self &o) const {
  130|    474|    Self ret;
  131|  1.89k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.42k, False: 474]
  ------------------
  132|  1.42k|      ret[i] = (*this)[i] + o[i];
  133|  1.42k|    }
  134|    474|    return ret;
  135|    474|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|    474|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|    474|  return v * o;
  294|    474|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|    474|  Self operator*(const Scalar &o) const {
  175|    474|    Self ret;
  176|  1.89k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.42k, False: 474]
  ------------------
  177|  1.42k|      ret[i] = (*this)[i] * o;
  178|  1.42k|    }
  179|    474|    return ret;
  180|    474|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|  1.60k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  1.60k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  1.60k|    v_[0] = c0;
   55|  1.60k|    v_[1] = c1;
   56|  1.60k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  3.32k|  VectorD() {
   41|  9.97k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.64k, False: 3.32k]
  ------------------
   42|  6.64k|      (*this)[i] = Scalar(0);
   43|  6.64k|    }
   44|  3.32k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|    948|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  2.84k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 1.89k, False: 948]
  ------------------
  104|  1.89k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 1.89k, False: 0]
  ------------------
  105|  1.89k|        v_[i] = Scalar(src_vector[i]);
  106|  1.89k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  1.89k|    }
  110|    948|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|     75|  Self operator+(const Self &o) const {
  130|     75|    Self ret;
  131|    225|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 150, False: 75]
  ------------------
  132|    150|      ret[i] = (*this)[i] + o[i];
  133|    150|    }
  134|     75|    return ret;
  135|     75|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|    474|  VectorD() {
   41|  1.42k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 948, False: 474]
  ------------------
   42|    948|      (*this)[i] = Scalar(0);
   43|    948|    }
   44|    474|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  2.84k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  1.89k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|    474|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  1.42k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 948, False: 474]
  ------------------
  104|    948|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 948, False: 0]
  ------------------
  105|    948|        v_[i] = Scalar(src_vector[i]);
  106|    948|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|    948|    }
  110|    474|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|    474|  Self operator/(const Scalar &o) const {
  183|    474|    Self ret;
  184|  1.42k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 948, False: 474]
  ------------------
  185|    948|      ret[i] = (*this)[i] / o;
  186|    948|    }
  187|    474|    return ret;
  188|    474|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|    399|  Self operator-(const Self &o) const {
  138|    399|    Self ret;
  139|  1.19k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 798, False: 399]
  ------------------
  140|    798|      ret[i] = (*this)[i] - o[i];
  141|    798|    }
  142|    399|    return ret;
  143|    399|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  13.2k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|   310k|  VectorD() {
   41|  1.24M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 930k, False: 310k]
  ------------------
   42|   930k|      (*this)[i] = Scalar(0);
   43|   930k|    }
   44|   310k|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  1.25M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  1.25M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  1.25M|    v_[0] = c0;
   55|  1.25M|    v_[1] = c1;
   56|  1.25M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|   871k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  2.61M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 1.74M, False: 871k]
  ------------------
  104|  1.74M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 1.74M, False: 0]
  ------------------
  105|  1.74M|        v_[i] = Scalar(src_vector[i]);
  106|  1.74M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  1.74M|    }
  110|   871k|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|   435k|  VectorD() {
   41|  1.30M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 871k, False: 435k]
  ------------------
   42|   871k|      (*this)[i] = Scalar(0);
   43|   871k|    }
   44|   435k|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|   435k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  1.30M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 871k, False: 435k]
  ------------------
  104|   871k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 871k, False: 0]
  ------------------
  105|   871k|        v_[i] = Scalar(src_vector[i]);
  106|   871k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   871k|    }
  110|   435k|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|   808k|  VectorD(const Self &o) {
   89|  2.42M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.61M, False: 808k]
  ------------------
   90|  1.61M|      (*this)[i] = o[i];
   91|  1.61M|    }
   92|   808k|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|   302k|  VectorD() {
   41|   907k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 604k, False: 302k]
  ------------------
   42|   604k|      (*this)[i] = Scalar(0);
   43|   604k|    }
   44|   302k|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|     44|  VectorD(const Self &o) {
   89|    176|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 132, False: 44]
  ------------------
   90|    132|      (*this)[i] = o[i];
   91|    132|    }
   92|     44|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|    132|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|     44|      : v_({{c0, c1, c2}}) {
   60|     44|    DRACO_DCHECK_EQ(dimension, 3);
   61|     44|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  11.1M|  inline int num_vertices() const {
   74|  11.1M|    return static_cast<int>(vertex_corners_.size());
   75|  11.1M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  1.03M|  inline int num_corners() const {
   77|  1.03M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  1.03M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  50.2k|  inline int num_faces() const {
   80|  50.2k|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  50.2k|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|  65.0M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|  65.0M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 65.0M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|  65.0M|    return opposite_corners_[corner];
   88|  65.0M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|  91.2M|  inline CornerIndex Next(CornerIndex corner) const {
   90|  91.2M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 3.64M, False: 87.5M]
  ------------------
   91|  3.64M|      return corner;
   92|  3.64M|    }
   93|  87.5M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 69.2M, False: 18.3M]
  ------------------
   94|  91.2M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|  64.9M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|  64.9M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 303k, False: 64.6M]
  ------------------
   97|   303k|      return corner;
   98|   303k|    }
   99|  64.6M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 27.9M, False: 36.6M]
  ------------------
  100|  64.9M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  86.6M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  86.6M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 86.6M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  86.6M|    return ConfidentVertex(corner);
  106|  86.6M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  86.6M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  86.6M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  86.6M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  86.6M|    return corner_to_vertex_map_[corner];
  111|  86.6M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  4.10M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  4.10M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 4.10M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  4.10M|    return FaceIndex(corner.value() / 3);
  117|  4.10M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   152M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  14.3M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  14.3M|    return vertex_corners_[v];
  152|  14.3M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   319k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   319k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   319k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 1.15k, False: 318k]
  ------------------
  188|  1.15k|      return true;
  189|  1.15k|    }
  190|   318k|    return false;
  191|   319k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  15.3M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  15.3M|    return Previous(Opposite(Previous(corner)));
  202|  15.3M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  11.5M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  11.5M|    return Next(Opposite(Next(corner)));
  207|  11.5M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|   374k|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|   374k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 374k]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|   374k|    return Opposite(Previous(corner_id));
  222|   374k|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|   693k|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|   693k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 693k]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|   693k|    return Opposite(Next(corner_id));
  228|   693k|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|  55.1M|                                CornerIndex opp_corner_id) {
  249|  55.1M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|  55.1M|    opposite_corners_[corner_id] = opp_corner_id;
  251|  55.1M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|  70.2M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|  70.2M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|  70.2M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|  70.2M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  17.3M|  VertexIndex AddNewVertex() {
  271|  17.3M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  17.3M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  17.3M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  17.3M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|  35.1M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|  35.1M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|  35.1M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 35.1M, False: 0]
  ------------------
  295|  35.1M|      vertex_corners_[vert] = corner;
  296|  35.1M|    }
  297|  35.1M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  1.91M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  1.91M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  1.91M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  1.91M|  }

_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  2.01M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  1.72M|  void Next() {
  248|  1.72M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.72M, False: 2.84k]
  ------------------
  249|  1.72M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.72M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 3.65k, False: 1.71M]
  ------------------
  251|       |        // Open boundary reached.
  252|  3.65k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  3.65k|        left_traversal_ = false;
  254|  1.71M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 287k, False: 1.43M]
  ------------------
  255|       |        // End reached.
  256|   287k|        corner_ = kInvalidCornerIndex;
  257|   287k|      }
  258|  1.72M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  2.84k|      corner_ = corner_table_->SwingRight(corner_);
  262|  2.84k|    }
  263|  1.72M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  3.44M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  96.0k|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|   121k|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  61.0k|  void Next() {
  248|  61.0k|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 58.3k, False: 2.72k]
  ------------------
  249|  58.3k|      corner_ = corner_table_->SwingLeft(corner_);
  250|  58.3k|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 30.6k, False: 27.6k]
  ------------------
  251|       |        // Open boundary reached.
  252|  30.6k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  30.6k|        left_traversal_ = false;
  254|  30.6k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 4.35k, False: 23.2k]
  ------------------
  255|       |        // End reached.
  256|  4.35k|        corner_ = kInvalidCornerIndex;
  257|  4.35k|      }
  258|  58.3k|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  2.72k|      corner_ = corner_table_->SwingRight(corner_);
  262|  2.72k|    }
  263|  61.0k|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  35.0k|      : corner_table_(table),
  236|  35.0k|        start_corner_(corner_id),
  237|  35.0k|        corner_(start_corner_),
  238|  35.0k|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   290k|      : corner_table_(table),
  236|   290k|        start_corner_(corner_id),
  237|   290k|        corner_(start_corner_),
  238|   290k|        left_traversal_(true) {}

_ZN5draco4MeshC2Ev:
   29|    845|Mesh::Mesh() {}

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

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

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

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

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

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

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

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

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

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

_ZNK5draco10PointCloud14num_attributesEv:
   75|    289|  int32_t num_attributes() const {
   76|    289|    return static_cast<int32_t>(attributes_.size());
   77|    289|  }
_ZNK5draco10PointCloud9attributeEi:
   78|  1.08k|  const PointAttribute *attribute(int32_t att_id) const {
   79|  1.08k|    DRACO_DCHECK_LE(0, att_id);
   80|  1.08k|    DRACO_DCHECK_LT(att_id, static_cast<int32_t>(attributes_.size()));
   81|  1.08k|    return attributes_[att_id].get();
   82|  1.08k|  }
_ZN5draco10PointCloud9attributeEi:
   86|  14.4k|  PointAttribute *attribute(int32_t att_id) {
   87|  14.4k|    DRACO_DCHECK_LE(0, att_id);
   88|  14.4k|    DRACO_DCHECK_LT(att_id, static_cast<int32_t>(attributes_.size()));
   89|  14.4k|    return attributes_[att_id].get();
   90|  14.4k|  }
_ZNK5draco10PointCloud10num_pointsEv:
  195|  9.78k|  PointIndex::ValueType num_points() const { return num_points_; }
_ZN5draco10PointCloud14set_num_pointsEj:
  200|    619|  void set_num_points(PointIndex::ValueType num) { num_points_ = num; }
_ZN5draco10PointCloudD2Ev:
   36|  1.14k|  virtual ~PointCloud() = default;

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

