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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.21k|      : quantization_bits_(-1),
   54|  2.21k|        max_quantized_value_(-1),
   55|  2.21k|        max_value_(-1),
   56|  2.21k|        dequantization_scale_(1.f),
   57|  2.21k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  1.98k|  bool SetQuantizationBits(int32_t q) {
   60|  1.98k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 726, False: 1.26k]
  |  Branch (60:18): [True: 114, False: 1.14k]
  ------------------
   61|    840|      return false;
   62|    840|    }
   63|  1.14k|    quantization_bits_ = q;
   64|  1.14k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.14k|    max_value_ = max_quantized_value_ - 1;
   66|  1.14k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.14k|    center_value_ = max_value_ / 2;
   68|  1.14k|    return true;
   69|  1.98k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.17M|                                           int32_t *out_t) const {
   77|  2.17M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 4.18k, False: 2.17M]
  |  Branch (77:20): [True: 0, False: 4.18k]
  |  Branch (77:32): [True: 4.18k, False: 2.17M]
  |  Branch (77:42): [True: 0, False: 4.18k]
  ------------------
   78|  2.17M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.49M, False: 682k]
  |  Branch (78:29): [True: 6.51k, False: 1.48M]
  ------------------
   79|  6.51k|      s = max_value_;
   80|  6.51k|      t = max_value_;
   81|  2.16M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 4.18k, False: 2.16M]
  |  Branch (81:26): [True: 1.71k, False: 2.47k]
  ------------------
   82|  1.71k|      t = center_value_ - (t - center_value_);
   83|  2.16M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.48M, False: 681k]
  |  Branch (83:35): [True: 6.00k, False: 1.47M]
  ------------------
   84|  6.00k|      t = center_value_ + (center_value_ - t);
   85|  2.16M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.48M, False: 679k]
  |  Branch (85:35): [True: 823, False: 1.48M]
  ------------------
   86|    823|      s = center_value_ + (center_value_ - s);
   87|  2.15M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.74k, False: 2.15M]
  |  Branch (87:26): [True: 1.65k, False: 3.08k]
  ------------------
   88|  1.65k|      s = center_value_ - (s - center_value_);
   89|  1.65k|    }
   90|       |
   91|  2.17M|    *out_s = s;
   92|  2.17M|    *out_t = t;
   93|  2.17M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.17M|                                                       int32_t *out_t) const {
  100|  2.17M|    DRACO_DCHECK_EQ(
  101|  2.17M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.17M|        center_value_);
  103|  2.17M|    int32_t s, t;
  104|  2.17M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.39M, False: 780k]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.39M|      s = (int_vec[1] + center_value_);
  107|  1.39M|      t = (int_vec[2] + center_value_);
  108|  1.39M|    } else {
  109|       |      // Left hemisphere.
  110|   780k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 47.3k, False: 733k]
  ------------------
  111|  47.3k|        s = std::abs(int_vec[2]);
  112|   733k|      } else {
  113|   733k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   733k|      }
  115|   780k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 53.0k, False: 727k]
  ------------------
  116|  53.0k|        t = std::abs(int_vec[1]);
  117|   727k|      } else {
  118|   727k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   727k|      }
  120|   780k|    }
  121|  2.17M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.17M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  25.5M|                                                    float *out_vector) const {
  199|  25.5M|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  25.5M|                                 in_t * dequantization_scale_ - 1.f,
  201|  25.5M|                                 out_vector);
  202|  25.5M|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  32.3M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  32.3M|    DRACO_DCHECK_LE(s, center_value_);
  208|  32.3M|    DRACO_DCHECK_LE(t, center_value_);
  209|  32.3M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  32.3M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  32.3M|    const uint32_t st =
  212|  32.3M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  32.3M|    return st <= center_value_;
  214|  32.3M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  63.5M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  63.5M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  63.5M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  63.5M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  63.5M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  63.5M|    int32_t sign_s = 0;
  223|  63.5M|    int32_t sign_t = 0;
  224|  63.5M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 63.1M, False: 389k]
  |  Branch (224:20): [True: 62.9M, False: 139k]
  ------------------
  225|  62.9M|      sign_s = 1;
  226|  62.9M|      sign_t = 1;
  227|  62.9M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 414k, False: 114k]
  |  Branch (227:27): [True: 254k, False: 159k]
  ------------------
  228|   254k|      sign_s = -1;
  229|   254k|      sign_t = -1;
  230|   274k|    } else {
  231|   274k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 114k, False: 159k]
  ------------------
  232|   274k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 159k, False: 114k]
  ------------------
  233|   274k|    }
  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|  63.5M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  63.5M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  63.5M|    uint32_t us = *s;
  241|  63.5M|    uint32_t ut = *t;
  242|  63.5M|    us = us + us - corner_point_s;
  243|  63.5M|    ut = ut + ut - corner_point_t;
  244|  63.5M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 63.2M, False: 274k]
  ------------------
  245|  63.2M|      uint32_t temp = us;
  246|  63.2M|      us = -ut;
  247|  63.2M|      ut = -temp;
  248|  63.2M|    } else {
  249|   274k|      std::swap(us, ut);
  250|   274k|    }
  251|  63.5M|    us = us + corner_point_s;
  252|  63.5M|    ut = ut + corner_point_t;
  253|       |
  254|  63.5M|    *s = us;
  255|  63.5M|    *t = ut;
  256|  63.5M|    *s /= 2;
  257|  63.5M|    *t /= 2;
  258|  63.5M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  64.6M|  int32_t ModMax(int32_t x) const {
  273|  64.6M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 1.80k, False: 64.6M]
  ------------------
  274|  1.80k|      return x - this->max_quantized_value();
  275|  1.80k|    }
  276|  64.6M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 1.29k, False: 64.6M]
  ------------------
  277|  1.29k|      return x + this->max_quantized_value();
  278|  1.29k|    }
  279|  64.6M|    return x;
  280|  64.6M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.11k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  3.09k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|   193M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  25.5M|                                           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|  25.5M|    float y = in_s_scaled;
  329|  25.5M|    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|  25.5M|    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|  25.5M|    float x_offset = -x;
  342|  25.5M|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 162k, False: 25.4M]
  ------------------
  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|  25.5M|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 20.2k, False: 25.5M]
  ------------------
  348|  25.5M|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 46.9k, False: 25.5M]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  25.5M|    const float norm_squared = x * x + y * y + z * z;
  352|  25.5M|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 25.5M]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  25.5M|    } else {
  357|  25.5M|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  25.5M|      out_vector[0] = x * d;
  359|  25.5M|      out_vector[1] = y * d;
  360|  25.5M|      out_vector[2] = z * d;
  361|  25.5M|    }
  362|  25.5M|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.17M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.17M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.17M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.17M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.17M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.17M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.17M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.91M, False: 257k]
  ------------------
  181|  1.91M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.91M|    } else {
  183|   257k|      vec[0] =
  184|   257k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   257k|          abs_sum;
  186|   257k|      vec[1] =
  187|   257k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   257k|          abs_sum;
  189|   257k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 138k, False: 119k]
  ------------------
  190|   138k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   138k|      } else {
  192|   119k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   119k|      }
  194|   257k|    }
  195|  2.17M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    417|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    417|            attribute, transform, mesh_data),
   52|    417|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    400|                                                                *buffer) {
  197|    400|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    400|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    400|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 2, False: 398]
  ------------------
  199|       |    // Decode prediction mode.
  200|      2|    uint8_t mode;
  201|      2|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 0, False: 2]
  ------------------
  202|      0|      return false;
  203|      0|    }
  204|       |
  205|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 1, False: 1]
  ------------------
  206|       |      // Unsupported mode.
  207|      1|      return false;
  208|      1|    }
  209|      2|  }
  210|    399|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  1.83k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 1.51k, False: 320]
  ------------------
  214|  1.51k|    uint32_t num_flags;
  215|  1.51k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 11, False: 1.50k]
  ------------------
  216|     11|      return false;
  217|     11|    }
  218|  1.50k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 50, False: 1.45k]
  ------------------
  219|     50|      return false;
  220|     50|    }
  221|  1.45k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 561, False: 893]
  ------------------
  222|    561|      is_crease_edge_[i].resize(num_flags);
  223|    561|      RAnsBitDecoder decoder;
  224|    561|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 18, False: 543]
  ------------------
  225|     18|        return false;
  226|     18|      }
  227|  1.68M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.68M, False: 543]
  ------------------
  228|  1.68M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.68M|      }
  230|    543|      decoder.EndDecoding();
  231|    543|    }
  232|  1.45k|  }
  233|    320|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    320|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    399|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    273|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    273|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    273|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.36k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.09k, False: 273]
  ------------------
   93|  1.09k|    pred_vals[i].resize(num_components, 0);
   94|  1.09k|  }
   95|    273|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    273|                                         out_data);
   97|       |
   98|    273|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    273|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    273|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    273|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    273|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    273|  const int corner_map_size =
  109|    273|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    273|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 273]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   738k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 738k, False: 169]
  ------------------
  114|   738k|    const CornerIndex start_corner_id =
  115|   738k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   738k|    CornerIndex corner_id(start_corner_id);
  118|   738k|    int num_parallelograms = 0;
  119|   738k|    bool first_pass = true;
  120|  1.60M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 889k, False: 710k]
  ------------------
  121|   889k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 60.7k, False: 829k]
  ------------------
  122|   889k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   889k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|  60.7k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|  60.7k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 491, False: 60.2k]
  ------------------
  130|    491|          break;
  131|    491|        }
  132|  60.7k|      }
  133|       |
  134|       |      // Proceed to the next corner attached to the vertex. First swing left
  135|       |      // and if we reach a boundary, swing right from the start corner.
  136|   889k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 882k, False: 6.89k]
  ------------------
  137|   882k|        corner_id = table->SwingLeft(corner_id);
  138|   882k|      } else {
  139|  6.89k|        corner_id = table->SwingRight(corner_id);
  140|  6.89k|      }
  141|   889k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 27.6k, False: 861k]
  ------------------
  142|  27.6k|        break;
  143|  27.6k|      }
  144|   861k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 713k, False: 148k]
  |  Branch (144:47): [True: 710k, False: 3.11k]
  ------------------
  145|   710k|        first_pass = false;
  146|   710k|        corner_id = table->SwingRight(start_corner_id);
  147|   710k|      }
  148|   861k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   738k|    int num_used_parallelograms = 0;
  153|   738k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 32.6k, False: 705k]
  ------------------
  154|  6.31M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 6.28M, False: 32.6k]
  ------------------
  155|  6.28M|        multi_pred_vals[i] = 0;
  156|  6.28M|      }
  157|       |      // Check which parallelograms are actually used.
  158|  93.2k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 60.6k, False: 32.5k]
  ------------------
  159|  60.6k|        const int context = num_parallelograms - 1;
  160|  60.6k|        const int pos = is_crease_edge_pos[context]++;
  161|  60.6k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 104, False: 60.5k]
  ------------------
  162|    104|          return false;
  163|    104|        }
  164|  60.5k|        const bool is_crease = is_crease_edge_[context][pos];
  165|  60.5k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 17.2k, False: 43.3k]
  ------------------
  166|  17.2k|          ++num_used_parallelograms;
  167|  3.07M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 3.05M, False: 17.2k]
  ------------------
  168|  3.05M|            multi_pred_vals[j] =
  169|  3.05M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  3.05M|          }
  171|  17.2k|        }
  172|  60.5k|      }
  173|  32.6k|    }
  174|   738k|    const int dst_offset = p * num_components;
  175|   738k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 731k, False: 7.13k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|   731k|      const int src_offset = (p - 1) * num_components;
  179|   731k|      this->transform().ComputeOriginalValue(
  180|   731k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|   731k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|  1.22M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 1.22M, False: 7.13k]
  ------------------
  184|  1.22M|        multi_pred_vals[c] /= num_used_parallelograms;
  185|  1.22M|      }
  186|  7.13k|      this->transform().ComputeOriginalValue(
  187|  7.13k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  7.13k|    }
  189|   738k|  }
  190|    169|  return true;
  191|    273|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    476|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    476|            attribute, transform, mesh_data),
   52|    476|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    445|                                                                *buffer) {
  197|    445|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    445|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    445|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 3, False: 442]
  ------------------
  199|       |    // Decode prediction mode.
  200|      3|    uint8_t mode;
  201|      3|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 0, False: 3]
  ------------------
  202|      0|      return false;
  203|      0|    }
  204|       |
  205|      3|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 1, False: 2]
  ------------------
  206|       |      // Unsupported mode.
  207|      1|      return false;
  208|      1|    }
  209|      3|  }
  210|    444|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  1.92k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 1.58k, False: 338]
  ------------------
  214|  1.58k|    uint32_t num_flags;
  215|  1.58k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 14, False: 1.56k]
  ------------------
  216|     14|      return false;
  217|     14|    }
  218|  1.56k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 65, False: 1.50k]
  ------------------
  219|     65|      return false;
  220|     65|    }
  221|  1.50k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 643, False: 860]
  ------------------
  222|    643|      is_crease_edge_[i].resize(num_flags);
  223|    643|      RAnsBitDecoder decoder;
  224|    643|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 27, False: 616]
  ------------------
  225|     27|        return false;
  226|     27|      }
  227|  1.59M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.59M, False: 616]
  ------------------
  228|  1.59M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.59M|      }
  230|    616|      decoder.EndDecoding();
  231|    616|    }
  232|  1.50k|  }
  233|    338|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    338|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    444|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    290|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    290|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    290|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.45k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.16k, False: 290]
  ------------------
   93|  1.16k|    pred_vals[i].resize(num_components, 0);
   94|  1.16k|  }
   95|    290|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    290|                                         out_data);
   97|       |
   98|    290|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    290|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    290|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    290|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    290|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    290|  const int corner_map_size =
  109|    290|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    290|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 290]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   113k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 113k, False: 91]
  ------------------
  114|   113k|    const CornerIndex start_corner_id =
  115|   113k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   113k|    CornerIndex corner_id(start_corner_id);
  118|   113k|    int num_parallelograms = 0;
  119|   113k|    bool first_pass = true;
  120|   664k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 657k, False: 6.46k]
  ------------------
  121|   657k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 212k, False: 445k]
  ------------------
  122|   657k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   657k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|   212k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|   212k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 472, False: 211k]
  ------------------
  130|    472|          break;
  131|    472|        }
  132|   212k|      }
  133|       |
  134|       |      // Proceed to the next corner attached to the vertex. First swing left
  135|       |      // and if we reach a boundary, swing right from the start corner.
  136|   657k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 650k, False: 6.98k]
  ------------------
  137|   650k|        corner_id = table->SwingLeft(corner_id);
  138|   650k|      } else {
  139|  6.98k|        corner_id = table->SwingRight(corner_id);
  140|  6.98k|      }
  141|   657k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 106k, False: 550k]
  ------------------
  142|   106k|        break;
  143|   106k|      }
  144|   550k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 9.90k, False: 540k]
  |  Branch (144:47): [True: 6.47k, False: 3.43k]
  ------------------
  145|  6.47k|        first_pass = false;
  146|  6.47k|        corner_id = table->SwingRight(start_corner_id);
  147|  6.47k|      }
  148|   550k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   113k|    int num_used_parallelograms = 0;
  153|   113k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 110k, False: 3.16k]
  ------------------
  154|  4.93M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 4.82M, False: 110k]
  ------------------
  155|  4.82M|        multi_pred_vals[i] = 0;
  156|  4.82M|      }
  157|       |      // Check which parallelograms are actually used.
  158|   322k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 212k, False: 110k]
  ------------------
  159|   212k|        const int context = num_parallelograms - 1;
  160|   212k|        const int pos = is_crease_edge_pos[context]++;
  161|   212k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 199, False: 211k]
  ------------------
  162|    199|          return false;
  163|    199|        }
  164|   211k|        const bool is_crease = is_crease_edge_[context][pos];
  165|   211k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 52.5k, False: 159k]
  ------------------
  166|  52.5k|          ++num_used_parallelograms;
  167|  2.44M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 2.39M, False: 52.5k]
  ------------------
  168|  2.39M|            multi_pred_vals[j] =
  169|  2.39M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  2.39M|          }
  171|  52.5k|        }
  172|   211k|      }
  173|   110k|    }
  174|   113k|    const int dst_offset = p * num_components;
  175|   113k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 87.8k, False: 25.7k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|  87.8k|      const int src_offset = (p - 1) * num_components;
  179|  87.8k|      this->transform().ComputeOriginalValue(
  180|  87.8k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|  87.8k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|  1.26M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 1.23M, False: 25.7k]
  ------------------
  184|  1.23M|        multi_pred_vals[c] /= num_used_parallelograms;
  185|  1.23M|      }
  186|  25.7k|      this->transform().ComputeOriginalValue(
  187|  25.7k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  25.7k|    }
  189|   113k|  }
  190|     91|  return true;
  191|    290|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.28k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.28k|    mesh_ = mesh;
   39|  2.28k|    corner_table_ = table;
   40|  2.28k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.28k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.28k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  12.7M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  8.62M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  8.62M|    return vertex_to_data_map_;
   48|  8.62M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  7.42M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  7.42M|    return data_to_corner_map_;
   51|  7.42M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.49k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.49k|    mesh_ = mesh;
   39|  2.49k|    corner_table_ = table;
   40|  2.49k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.49k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.49k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  9.32M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  7.93M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  7.93M|    return vertex_to_data_map_;
   48|  7.93M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.41M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.41M|    return data_to_corner_map_;
   51|  2.41M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  2.28k|      : mesh_(nullptr),
   31|  2.28k|        corner_table_(nullptr),
   32|  2.28k|        vertex_to_data_map_(nullptr),
   33|  2.28k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  2.49k|      : mesh_(nullptr),
   31|  2.49k|        corner_table_(nullptr),
   32|  2.49k|        vertex_to_data_map_(nullptr),
   33|  2.49k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   539k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   147k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   332k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   243k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.97k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.97k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  10.9M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.23k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.23k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  3.16M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    135|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    135|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    115|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    115|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    143|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    143|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    138|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    138|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    268|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    135|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    135|    DRACO_DCHECK_EQ(i, 0);
   70|    135|    (void)i;
   71|    135|    return GeometryAttribute::POSITION;
   72|    135|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    134|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    134|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 134]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    134|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 133]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    133|    predictor_.SetPositionAttribute(*att);
   82|    133|    return true;
   83|    134|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    133|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    133|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 8, False: 125]
  ------------------
  148|      8|    return false;
  149|      8|  }
  150|       |
  151|    125|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    125|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    125|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 22, False: 103]
  ------------------
  153|     22|    uint8_t prediction_mode;
  154|     22|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 22]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     22|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 21]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     21|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 21]
  ------------------
  163|     21|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     21|  }
  167|    124|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    124|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 3, False: 121]
  ------------------
  171|      3|    return false;
  172|      3|  }
  173|       |
  174|    121|  return true;
  175|    124|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    121|                                      const PointIndex *entry_to_point_id_map) {
  103|    121|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    121|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    121|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    121|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    121|  const int corner_map_size =
  111|    121|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    121|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 121]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    121|  VectorD<int32_t, 3> pred_normal_3d;
  117|    121|  int32_t pred_normal_oct[2];
  118|       |
  119|   539k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 539k, False: 121]
  ------------------
  120|   539k|    const CornerIndex corner_id =
  121|   539k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   539k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   539k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   539k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   539k|                    octahedron_tool_box_.center_value());
  128|   539k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 172k, False: 366k]
  ------------------
  129|   172k|      pred_normal_3d = -pred_normal_3d;
  130|   172k|    }
  131|   539k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   539k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   539k|    const int data_offset = data_id * 2;
  135|   539k|    this->transform().ComputeOriginalValue(
  136|   539k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   539k|  }
  138|    121|  flip_normal_bit_decoder_.EndDecoding();
  139|    121|  return true;
  140|    121|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    121|  void SetQuantizationBits(int q) {
   85|    121|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    121|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    229|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    115|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    115|    DRACO_DCHECK_EQ(i, 0);
   70|    115|    (void)i;
   71|    115|    return GeometryAttribute::POSITION;
   72|    115|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    115|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    115|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 115]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    115|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 114]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    114|    predictor_.SetPositionAttribute(*att);
   82|    114|    return true;
   83|    115|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    114|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    114|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 108]
  ------------------
  148|      6|    return false;
  149|      6|  }
  150|       |
  151|    108|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    108|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    108|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 15, False: 93]
  ------------------
  153|     15|    uint8_t prediction_mode;
  154|     15|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 15]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     15|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 14]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     14|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 14]
  ------------------
  163|     14|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     14|  }
  167|    107|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    107|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 2, False: 105]
  ------------------
  171|      2|    return false;
  172|      2|  }
  173|       |
  174|    105|  return true;
  175|    107|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    105|                                      const PointIndex *entry_to_point_id_map) {
  103|    105|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    105|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    105|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    105|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    105|  const int corner_map_size =
  111|    105|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    105|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 105]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    105|  VectorD<int32_t, 3> pred_normal_3d;
  117|    105|  int32_t pred_normal_oct[2];
  118|       |
  119|   147k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 146k, False: 105]
  ------------------
  120|   146k|    const CornerIndex corner_id =
  121|   146k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   146k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   146k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   146k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   146k|                    octahedron_tool_box_.center_value());
  128|   146k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 98.2k, False: 48.7k]
  ------------------
  129|  98.2k|      pred_normal_3d = -pred_normal_3d;
  130|  98.2k|    }
  131|   146k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   146k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   146k|    const int data_offset = data_id * 2;
  135|   146k|    this->transform().ComputeOriginalValue(
  136|   146k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   146k|  }
  138|    105|  flip_normal_bit_decoder_.EndDecoding();
  139|    105|  return true;
  140|    105|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    105|  void SetQuantizationBits(int q) {
   85|    105|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    105|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    285|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    143|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    143|    DRACO_DCHECK_EQ(i, 0);
   70|    143|    (void)i;
   71|    143|    return GeometryAttribute::POSITION;
   72|    143|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    143|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    143|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 143]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    143|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 142]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    142|    predictor_.SetPositionAttribute(*att);
   82|    142|    return true;
   83|    143|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    142|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    142|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 136]
  ------------------
  148|      6|    return false;
  149|      6|  }
  150|       |
  151|    136|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    136|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    136|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 42, False: 94]
  ------------------
  153|     42|    uint8_t prediction_mode;
  154|     42|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 42]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     42|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 14, False: 28]
  ------------------
  158|       |      // Invalid prediction mode.
  159|     14|      return false;
  160|     14|    }
  161|       |
  162|     28|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 28]
  ------------------
  163|     28|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     28|  }
  167|    122|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    122|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 6, False: 116]
  ------------------
  171|      6|    return false;
  172|      6|  }
  173|       |
  174|    116|  return true;
  175|    122|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_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|    116|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 116]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    116|  VectorD<int32_t, 3> pred_normal_3d;
  117|    116|  int32_t pred_normal_oct[2];
  118|       |
  119|   332k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 332k, False: 116]
  ------------------
  120|   332k|    const CornerIndex corner_id =
  121|   332k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   332k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   332k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   332k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   332k|                    octahedron_tool_box_.center_value());
  128|   332k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 257k, False: 74.7k]
  ------------------
  129|   257k|      pred_normal_3d = -pred_normal_3d;
  130|   257k|    }
  131|   332k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   332k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   332k|    const int data_offset = data_id * 2;
  135|   332k|    this->transform().ComputeOriginalValue(
  136|   332k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   332k|  }
  138|    116|  flip_normal_bit_decoder_.EndDecoding();
  139|    116|  return true;
  140|    116|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    116|  void SetQuantizationBits(int q) {
   85|    116|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    116|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    274|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    138|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    138|    DRACO_DCHECK_EQ(i, 0);
   70|    138|    (void)i;
   71|    138|    return GeometryAttribute::POSITION;
   72|    138|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    138|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    138|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 138]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    138|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 136]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    136|    predictor_.SetPositionAttribute(*att);
   82|    136|    return true;
   83|    138|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    136|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    136|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 130]
  ------------------
  148|      6|    return false;
  149|      6|  }
  150|       |
  151|    130|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    130|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    130|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 23, False: 107]
  ------------------
  153|     23|    uint8_t prediction_mode;
  154|     23|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 23]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     23|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 22]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     22|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 22]
  ------------------
  163|     22|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     22|  }
  167|    129|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    129|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 5, False: 124]
  ------------------
  171|      5|    return false;
  172|      5|  }
  173|       |
  174|    124|  return true;
  175|    129|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    124|                                      const PointIndex *entry_to_point_id_map) {
  103|    124|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    124|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    124|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    124|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    124|  const int corner_map_size =
  111|    124|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    124|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 124]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    124|  VectorD<int32_t, 3> pred_normal_3d;
  117|    124|  int32_t pred_normal_oct[2];
  118|       |
  119|   243k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 243k, False: 124]
  ------------------
  120|   243k|    const CornerIndex corner_id =
  121|   243k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   243k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   243k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   243k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   243k|                    octahedron_tool_box_.center_value());
  128|   243k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 242k, False: 982]
  ------------------
  129|   242k|      pred_normal_3d = -pred_normal_3d;
  130|   242k|    }
  131|   243k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   243k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   243k|    const int data_offset = data_id * 2;
  135|   243k|    this->transform().ComputeOriginalValue(
  136|   243k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   243k|  }
  138|    124|  flip_normal_bit_decoder_.EndDecoding();
  139|    124|  return true;
  140|    124|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    124|  void SetQuantizationBits(int q) {
   85|    124|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    124|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    279|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    279|            attribute, transform, mesh_data),
   37|    279|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    556|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    279|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    279|    DRACO_DCHECK_EQ(i, 0);
   70|    279|    (void)i;
   71|    279|    return GeometryAttribute::POSITION;
   72|    279|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    278|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    278|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 278]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    278|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 277]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    277|    predictor_.SetPositionAttribute(*att);
   82|    277|    return true;
   83|    278|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    275|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    275|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 24, False: 251]
  ------------------
  148|     24|    return false;
  149|     24|  }
  150|       |
  151|    251|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    251|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    251|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 76, False: 175]
  ------------------
  153|     76|    uint8_t prediction_mode;
  154|     76|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 76]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     76|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 74]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     74|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 74]
  ------------------
  163|     74|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     74|  }
  167|    249|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    249|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 12, False: 237]
  ------------------
  171|     12|    return false;
  172|     12|  }
  173|       |
  174|    237|  return true;
  175|    249|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    237|                                      const PointIndex *entry_to_point_id_map) {
  103|    237|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    237|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    237|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    237|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    237|  const int corner_map_size =
  111|    237|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    237|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 237]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    237|  VectorD<int32_t, 3> pred_normal_3d;
  117|    237|  int32_t pred_normal_oct[2];
  118|       |
  119|   743k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 743k, False: 237]
  ------------------
  120|   743k|    const CornerIndex corner_id =
  121|   743k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   743k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   743k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   743k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   743k|                    octahedron_tool_box_.center_value());
  128|   743k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 658k, False: 84.7k]
  ------------------
  129|   658k|      pred_normal_3d = -pred_normal_3d;
  130|   658k|    }
  131|   743k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   743k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   743k|    const int data_offset = data_id * 2;
  135|   743k|    this->transform().ComputeOriginalValue(
  136|   743k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   743k|  }
  138|    237|  flip_normal_bit_decoder_.EndDecoding();
  139|    237|  return true;
  140|    237|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    237|  void SetQuantizationBits(int q) {
   85|    237|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    237|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    451|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    451|            attribute, transform, mesh_data),
   37|    451|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    900|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    451|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    451|    DRACO_DCHECK_EQ(i, 0);
   70|    451|    (void)i;
   71|    451|    return GeometryAttribute::POSITION;
   72|    451|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    451|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    451|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 451]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    451|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 449]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    449|    predictor_.SetPositionAttribute(*att);
   82|    449|    return true;
   83|    451|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    444|                                                                *buffer) {
  146|       |  // Get data needed for transform
  147|    444|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 18, False: 426]
  ------------------
  148|     18|    return false;
  149|     18|  }
  150|       |
  151|    426|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    426|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    426|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 86, False: 340]
  ------------------
  153|     86|    uint8_t prediction_mode;
  154|     86|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 8, False: 78]
  ------------------
  155|      8|      return false;
  156|      8|    }
  157|     78|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 76]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     76|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 76]
  ------------------
  163|     76|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     76|  }
  167|    416|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    416|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 23, False: 393]
  ------------------
  171|     23|    return false;
  172|     23|  }
  173|       |
  174|    393|  return true;
  175|    416|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    393|                                      const PointIndex *entry_to_point_id_map) {
  103|    393|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    393|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    393|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    393|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    393|  const int corner_map_size =
  111|    393|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    393|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 393]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    393|  VectorD<int32_t, 3> pred_normal_3d;
  117|    393|  int32_t pred_normal_oct[2];
  118|       |
  119|   169k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 169k, False: 393]
  ------------------
  120|   169k|    const CornerIndex corner_id =
  121|   169k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   169k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   169k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   169k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   169k|                    octahedron_tool_box_.center_value());
  128|   169k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 159k, False: 9.50k]
  ------------------
  129|   159k|      pred_normal_3d = -pred_normal_3d;
  130|   159k|    }
  131|   169k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   169k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   169k|    const int data_offset = data_id * 2;
  135|   169k|    this->transform().ComputeOriginalValue(
  136|   169k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   169k|  }
  138|    393|  flip_normal_bit_decoder_.EndDecoding();
  139|    393|  return true;
  140|    393|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    393|  void SetQuantizationBits(int q) {
   85|    393|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    393|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    135|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    135|            attribute, transform, mesh_data),
   37|    135|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    115|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    115|            attribute, transform, mesh_data),
   37|    115|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    143|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    143|            attribute, transform, mesh_data),
   37|    143|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    138|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    138|            attribute, transform, mesh_data),
   37|    138|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    156|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    156|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 19, False: 137]
  ------------------
  105|     19|      this->normal_prediction_mode_ = mode;
  106|     19|      return true;
  107|    137|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 137, False: 0]
  ------------------
  108|    137|      this->normal_prediction_mode_ = mode;
  109|    137|      return true;
  110|    137|    }
  111|      0|    return false;
  112|    156|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   539k|                             DataTypeT *prediction) override {
   42|   539k|    DRACO_DCHECK(this->IsInitialized());
   43|   539k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   539k|    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|   539k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   539k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   539k|    VectorD<int64_t, 3> normal;
   53|   539k|    CornerIndex c_next, c_prev;
   54|  1.25M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 714k, False: 539k]
  ------------------
   55|       |      // Getting corners.
   56|   714k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 108, False: 714k]
  ------------------
   57|    108|        c_next = corner_table->Next(corner_id);
   58|    108|        c_prev = corner_table->Previous(corner_id);
   59|   714k|      } else {
   60|   714k|        c_next = corner_table->Next(cit.Corner());
   61|   714k|        c_prev = corner_table->Previous(cit.Corner());
   62|   714k|      }
   63|   714k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   714k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   714k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   714k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   714k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   714k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   714k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   714k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   714k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   714k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   714k|      cit.Next();
   81|   714k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   539k|    constexpr int64_t upper_bound = 1 << 29;
   85|   539k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 72, False: 539k]
  ------------------
   86|     72|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     72|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 31, False: 41]
  ------------------
   88|     31|        const int64_t quotient = abs_sum / upper_bound;
   89|     31|        normal = normal / quotient;
   90|     31|      }
   91|   539k|    } else {
   92|   539k|      const int64_t abs_sum = normal.AbsSum();
   93|   539k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.77k, False: 537k]
  ------------------
   94|  1.77k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.77k|        normal = normal / quotient;
   96|  1.77k|      }
   97|   539k|    }
   98|   539k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   539k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   539k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   539k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   539k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    129|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    129|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 13, False: 116]
  ------------------
  105|     13|      this->normal_prediction_mode_ = mode;
  106|     13|      return true;
  107|    116|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 116, False: 0]
  ------------------
  108|    116|      this->normal_prediction_mode_ = mode;
  109|    116|      return true;
  110|    116|    }
  111|      0|    return false;
  112|    129|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   146k|                             DataTypeT *prediction) override {
   42|   146k|    DRACO_DCHECK(this->IsInitialized());
   43|   146k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   146k|    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|   146k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   146k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   146k|    VectorD<int64_t, 3> normal;
   53|   146k|    CornerIndex c_next, c_prev;
   54|  1.02M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 876k, False: 146k]
  ------------------
   55|       |      // Getting corners.
   56|   876k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 72, False: 876k]
  ------------------
   57|     72|        c_next = corner_table->Next(corner_id);
   58|     72|        c_prev = corner_table->Previous(corner_id);
   59|   876k|      } else {
   60|   876k|        c_next = corner_table->Next(cit.Corner());
   61|   876k|        c_prev = corner_table->Previous(cit.Corner());
   62|   876k|      }
   63|   876k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   876k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   876k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   876k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   876k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   876k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   876k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   876k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   876k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   876k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   876k|      cit.Next();
   81|   876k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   146k|    constexpr int64_t upper_bound = 1 << 29;
   85|   146k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 48, False: 146k]
  ------------------
   86|     48|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     48|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 23, False: 25]
  ------------------
   88|     23|        const int64_t quotient = abs_sum / upper_bound;
   89|     23|        normal = normal / quotient;
   90|     23|      }
   91|   146k|    } else {
   92|   146k|      const int64_t abs_sum = normal.AbsSum();
   93|   146k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 94.3k, False: 52.5k]
  ------------------
   94|  94.3k|        const int64_t quotient = abs_sum / upper_bound;
   95|  94.3k|        normal = normal / quotient;
   96|  94.3k|      }
   97|   146k|    }
   98|   146k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   146k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   146k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   146k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   146k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    171|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    171|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 26, False: 145]
  ------------------
  105|     26|      this->normal_prediction_mode_ = mode;
  106|     26|      return true;
  107|    145|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 145, False: 0]
  ------------------
  108|    145|      this->normal_prediction_mode_ = mode;
  109|    145|      return true;
  110|    145|    }
  111|      0|    return false;
  112|    171|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   332k|                             DataTypeT *prediction) override {
   42|   332k|    DRACO_DCHECK(this->IsInitialized());
   43|   332k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   332k|    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|   332k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   332k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   332k|    VectorD<int64_t, 3> normal;
   53|   332k|    CornerIndex c_next, c_prev;
   54|  1.08M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 752k, False: 332k]
  ------------------
   55|       |      // Getting corners.
   56|   752k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 150, False: 752k]
  ------------------
   57|    150|        c_next = corner_table->Next(corner_id);
   58|    150|        c_prev = corner_table->Previous(corner_id);
   59|   752k|      } else {
   60|   752k|        c_next = corner_table->Next(cit.Corner());
   61|   752k|        c_prev = corner_table->Previous(cit.Corner());
   62|   752k|      }
   63|   752k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   752k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   752k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   752k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   752k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   752k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   752k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   752k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   752k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   752k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   752k|      cit.Next();
   81|   752k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   332k|    constexpr int64_t upper_bound = 1 << 29;
   85|   332k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 100, False: 331k]
  ------------------
   86|    100|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    100|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 38, False: 62]
  ------------------
   88|     38|        const int64_t quotient = abs_sum / upper_bound;
   89|     38|        normal = normal / quotient;
   90|     38|      }
   91|   331k|    } else {
   92|   331k|      const int64_t abs_sum = normal.AbsSum();
   93|   331k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.84k, False: 330k]
  ------------------
   94|  1.84k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.84k|        normal = normal / quotient;
   96|  1.84k|      }
   97|   331k|    }
   98|   332k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   332k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   332k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   332k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   332k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    160|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    160|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 21, False: 139]
  ------------------
  105|     21|      this->normal_prediction_mode_ = mode;
  106|     21|      return true;
  107|    139|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 139, False: 0]
  ------------------
  108|    139|      this->normal_prediction_mode_ = mode;
  109|    139|      return true;
  110|    139|    }
  111|      0|    return false;
  112|    160|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   243k|                             DataTypeT *prediction) override {
   42|   243k|    DRACO_DCHECK(this->IsInitialized());
   43|   243k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   243k|    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|   243k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   243k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   243k|    VectorD<int64_t, 3> normal;
   53|   243k|    CornerIndex c_next, c_prev;
   54|  1.69M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.45M, False: 243k]
  ------------------
   55|       |      // Getting corners.
   56|  1.45M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 120, False: 1.45M]
  ------------------
   57|    120|        c_next = corner_table->Next(corner_id);
   58|    120|        c_prev = corner_table->Previous(corner_id);
   59|  1.45M|      } else {
   60|  1.45M|        c_next = corner_table->Next(cit.Corner());
   61|  1.45M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.45M|      }
   63|  1.45M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.45M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.45M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.45M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.45M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.45M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.45M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.45M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.45M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.45M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.45M|      cit.Next();
   81|  1.45M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   243k|    constexpr int64_t upper_bound = 1 << 29;
   85|   243k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 80, False: 243k]
  ------------------
   86|     80|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     80|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 17, False: 63]
  ------------------
   88|     17|        const int64_t quotient = abs_sum / upper_bound;
   89|     17|        normal = normal / quotient;
   90|     17|      }
   91|   243k|    } else {
   92|   243k|      const int64_t abs_sum = normal.AbsSum();
   93|   243k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 136k, False: 106k]
  ------------------
   94|   136k|        const int64_t quotient = abs_sum / upper_bound;
   95|   136k|        normal = normal / quotient;
   96|   136k|      }
   97|   243k|    }
   98|   243k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   243k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   243k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   243k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   243k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    279|      : Base(md) {
   35|    279|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    279|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    353|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    353|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 73, False: 280]
  ------------------
  105|     73|      this->normal_prediction_mode_ = mode;
  106|     73|      return true;
  107|    280|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 280, False: 0]
  ------------------
  108|    280|      this->normal_prediction_mode_ = mode;
  109|    280|      return true;
  110|    280|    }
  111|      0|    return false;
  112|    353|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   743k|                             DataTypeT *prediction) override {
   42|   743k|    DRACO_DCHECK(this->IsInitialized());
   43|   743k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   743k|    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|   743k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   743k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   743k|    VectorD<int64_t, 3> normal;
   53|   743k|    CornerIndex c_next, c_prev;
   54|  1.51M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 775k, False: 743k]
  ------------------
   55|       |      // Getting corners.
   56|   775k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 408, False: 774k]
  ------------------
   57|    408|        c_next = corner_table->Next(corner_id);
   58|    408|        c_prev = corner_table->Previous(corner_id);
   59|   774k|      } else {
   60|   774k|        c_next = corner_table->Next(cit.Corner());
   61|   774k|        c_prev = corner_table->Previous(cit.Corner());
   62|   774k|      }
   63|   775k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   775k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   775k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   775k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   775k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   775k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   775k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   775k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   775k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   775k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   775k|      cit.Next();
   81|   775k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   743k|    constexpr int64_t upper_bound = 1 << 29;
   85|   743k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 342, False: 743k]
  ------------------
   86|    342|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    342|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 99, False: 243]
  ------------------
   88|     99|        const int64_t quotient = abs_sum / upper_bound;
   89|     99|        normal = normal / quotient;
   90|     99|      }
   91|   743k|    } else {
   92|   743k|      const int64_t abs_sum = normal.AbsSum();
   93|   743k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.79k, False: 740k]
  ------------------
   94|  2.79k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.79k|        normal = normal / quotient;
   96|  2.79k|      }
   97|   743k|    }
   98|   743k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   743k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   743k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   743k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   743k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    451|      : Base(md) {
   35|    451|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    451|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    527|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    527|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 75, False: 452]
  ------------------
  105|     75|      this->normal_prediction_mode_ = mode;
  106|     75|      return true;
  107|    452|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 452, False: 0]
  ------------------
  108|    452|      this->normal_prediction_mode_ = mode;
  109|    452|      return true;
  110|    452|    }
  111|      0|    return false;
  112|    527|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   169k|                             DataTypeT *prediction) override {
   42|   169k|    DRACO_DCHECK(this->IsInitialized());
   43|   169k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   169k|    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|   169k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   169k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   169k|    VectorD<int64_t, 3> normal;
   53|   169k|    CornerIndex c_next, c_prev;
   54|  1.11M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 946k, False: 169k]
  ------------------
   55|       |      // Getting corners.
   56|   946k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 414, False: 945k]
  ------------------
   57|    414|        c_next = corner_table->Next(corner_id);
   58|    414|        c_prev = corner_table->Previous(corner_id);
   59|   945k|      } else {
   60|   945k|        c_next = corner_table->Next(cit.Corner());
   61|   945k|        c_prev = corner_table->Previous(cit.Corner());
   62|   945k|      }
   63|   946k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   946k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   946k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   946k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   946k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   946k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   946k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   946k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   946k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   946k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   946k|      cit.Next();
   81|   946k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   169k|    constexpr int64_t upper_bound = 1 << 29;
   85|   169k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 394, False: 168k]
  ------------------
   86|    394|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    394|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 102, False: 292]
  ------------------
   88|    102|        const int64_t quotient = abs_sum / upper_bound;
   89|    102|        normal = normal / quotient;
   90|    102|      }
   91|   168k|    } else {
   92|   168k|      const int64_t abs_sum = normal.AbsSum();
   93|   168k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.20k, False: 165k]
  ------------------
   94|  3.20k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.20k|        normal = normal / quotient;
   96|  3.20k|      }
   97|   168k|    }
   98|   169k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   169k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   169k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   169k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   169k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    135|      : Base(md) {
   35|    135|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    135|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    115|      : Base(md) {
   35|    115|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    115|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    143|      : Base(md) {
   35|    143|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    143|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    138|      : Base(md) {
   35|    138|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    138|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_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_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   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_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    133|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    133|    pos_attribute_ = &position_attribute;
   43|    133|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    121|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    121|    entry_to_point_id_map_ = map;
   46|    121|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.89M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.89M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.89M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.89M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.89M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.89M|    return GetPositionForDataId(data_id);
   77|  1.89M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.89M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.89M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.89M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.89M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.89M|    VectorD<int64_t, 3> pos;
   68|  1.89M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.89M|    return pos;
   70|  1.89M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    114|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    114|    pos_attribute_ = &position_attribute;
   43|    114|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    105|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    105|    entry_to_point_id_map_ = map;
   46|    105|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.83M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.83M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.83M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.83M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.83M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.83M|    return GetPositionForDataId(data_id);
   77|  1.83M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.83M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.83M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.83M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.83M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.83M|    VectorD<int64_t, 3> pos;
   68|  1.83M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.83M|    return pos;
   70|  1.83M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    142|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    142|    pos_attribute_ = &position_attribute;
   43|    142|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    116|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    116|    entry_to_point_id_map_ = map;
   46|    116|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.15M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.15M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.15M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.15M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.15M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.15M|    return GetPositionForDataId(data_id);
   77|  3.15M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.15M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.15M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.15M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.15M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.15M|    VectorD<int64_t, 3> pos;
   68|  3.15M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.15M|    return pos;
   70|  3.15M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    136|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    136|    pos_attribute_ = &position_attribute;
   43|    136|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    124|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    124|    entry_to_point_id_map_ = map;
   46|    124|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    279|      : pos_attribute_(nullptr),
   36|    279|        entry_to_point_id_map_(nullptr),
   37|    279|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    279|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.29M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.29M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.29M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.29M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.29M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.29M|    return GetPositionForDataId(data_id);
   77|  2.29M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.29M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.29M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.29M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.29M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.29M|    VectorD<int64_t, 3> pos;
   68|  2.29M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.29M|    return pos;
   70|  2.29M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    277|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    277|    pos_attribute_ = &position_attribute;
   43|    277|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    237|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    237|    entry_to_point_id_map_ = map;
   46|    237|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    451|      : pos_attribute_(nullptr),
   36|    451|        entry_to_point_id_map_(nullptr),
   37|    451|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    451|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.06M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.06M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.06M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.06M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.06M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.06M|    return GetPositionForDataId(data_id);
   77|  2.06M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.06M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.06M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.06M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.06M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.06M|    VectorD<int64_t, 3> pos;
   68|  2.06M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.06M|    return pos;
   70|  2.06M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    449|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    449|    pos_attribute_ = &position_attribute;
   43|    449|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    393|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    393|    entry_to_point_id_map_ = map;
   46|    393|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    135|      : pos_attribute_(nullptr),
   36|    135|        entry_to_point_id_map_(nullptr),
   37|    135|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    135|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    115|      : pos_attribute_(nullptr),
   36|    115|        entry_to_point_id_map_(nullptr),
   37|    115|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    115|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    143|      : pos_attribute_(nullptr),
   36|    143|        entry_to_point_id_map_(nullptr),
   37|    143|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    143|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    138|      : pos_attribute_(nullptr),
   36|    138|        entry_to_point_id_map_(nullptr),
   37|    138|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    138|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    339|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    339|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    321|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    321|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    321|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    321|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    321|      new DataTypeT[num_components]());
   70|       |
   71|    321|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    321|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    321|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    321|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    321|  const int corner_map_size =
   78|    321|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    321|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 321]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|  1.73M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 1.73M, False: 321]
  ------------------
   83|  1.73M|    const CornerIndex start_corner_id =
   84|  1.73M|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|  1.73M|    CornerIndex corner_id(start_corner_id);
   87|  1.73M|    int num_parallelograms = 0;
   88|  88.2M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 86.5M, False: 1.73M]
  ------------------
   89|  86.5M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  86.5M|    }
   91|  3.96M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 2.23M, False: 1.73M]
  ------------------
   92|  2.23M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 202k, False: 2.02M]
  ------------------
   93|  2.23M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  2.23M|              num_components, parallelogram_pred_vals.get())) {
   95|  6.53M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 6.33M, False: 202k]
  ------------------
   96|  6.33M|          pred_vals[c] =
   97|  6.33M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  6.33M|        }
   99|   202k|        ++num_parallelograms;
  100|   202k|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  2.23M|      corner_id = table->SwingRight(corner_id);
  104|  2.23M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 95.0k, False: 2.13M]
  ------------------
  105|  95.0k|        corner_id = kInvalidCornerIndex;
  106|  95.0k|      }
  107|  2.23M|    }
  108|       |
  109|  1.73M|    const int dst_offset = p * num_components;
  110|  1.73M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 1.62M, False: 108k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  1.62M|      const int src_offset = (p - 1) * num_components;
  114|  1.62M|      this->transform().ComputeOriginalValue(
  115|  1.62M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|  1.62M|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  3.53M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 3.42M, False: 108k]
  ------------------
  119|  3.42M|        pred_vals[c] /= num_parallelograms;
  120|  3.42M|      }
  121|   108k|      this->transform().ComputeOriginalValue(
  122|   108k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|   108k|    }
  124|  1.73M|  }
  125|    321|  return true;
  126|    321|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    409|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    409|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    389|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    389|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    389|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    389|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    389|      new DataTypeT[num_components]());
   70|       |
   71|    389|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    389|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    389|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    389|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    389|  const int corner_map_size =
   78|    389|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    389|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 389]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|   724k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 724k, False: 389]
  ------------------
   83|   724k|    const CornerIndex start_corner_id =
   84|   724k|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|   724k|    CornerIndex corner_id(start_corner_id);
   87|   724k|    int num_parallelograms = 0;
   88|  22.1M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 21.4M, False: 724k]
  ------------------
   89|  21.4M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  21.4M|    }
   91|  5.02M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 4.29M, False: 724k]
  ------------------
   92|  4.29M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 1.41M, False: 2.88M]
  ------------------
   93|  4.29M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  4.29M|              num_components, parallelogram_pred_vals.get())) {
   95|  43.2M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 41.8M, False: 1.41M]
  ------------------
   96|  41.8M|          pred_vals[c] =
   97|  41.8M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  41.8M|        }
   99|  1.41M|        ++num_parallelograms;
  100|  1.41M|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  4.29M|      corner_id = table->SwingRight(corner_id);
  104|  4.29M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 712k, False: 3.58M]
  ------------------
  105|   712k|        corner_id = kInvalidCornerIndex;
  106|   712k|      }
  107|  4.29M|    }
  108|       |
  109|   724k|    const int dst_offset = p * num_components;
  110|   724k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 1.27k, False: 723k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  1.27k|      const int src_offset = (p - 1) * num_components;
  114|  1.27k|      this->transform().ComputeOriginalValue(
  115|  1.27k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|   723k|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  22.0M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 21.3M, False: 723k]
  ------------------
  119|  21.3M|        pred_vals[c] /= num_parallelograms;
  120|  21.3M|      }
  121|   723k|      this->transform().ComputeOriginalValue(
  122|   723k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|   723k|    }
  124|   724k|  }
  125|    389|  return true;
  126|    389|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  5.18M|    int num_components, DataTypeT *out_prediction) {
   49|  5.18M|  const CornerIndex oci = table->Opposite(ci);
   50|  5.18M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 4.33M, False: 850k]
  ------------------
   51|  4.33M|    return false;
   52|  4.33M|  }
   53|   850k|  int vert_opp, vert_next, vert_prev;
   54|   850k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   850k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   850k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 459k, False: 390k]
  |  Branch (56:35): [True: 358k, False: 101k]
  ------------------
   57|   358k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 335k, False: 22.1k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   335k|    const int v_opp_off = vert_opp * num_components;
   60|   335k|    const int v_next_off = vert_next * num_components;
   61|   335k|    const int v_prev_off = vert_prev * num_components;
   62|  23.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 23.2M, False: 335k]
  ------------------
   63|  23.2M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  23.2M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  23.2M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  23.2M|      const int64_t result =
   67|  23.2M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  23.2M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  23.2M|    }
   71|   335k|    return true;
   72|   335k|  }
   73|   514k|  return false;  // Not all data is available for prediction
   74|   850k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   850k|    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|   850k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   850k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   850k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   850k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  5.55M|    int num_components, DataTypeT *out_prediction) {
   49|  5.55M|  const CornerIndex oci = table->Opposite(ci);
   50|  5.55M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 18.7k, False: 5.53M]
  ------------------
   51|  18.7k|    return false;
   52|  18.7k|  }
   53|  5.53M|  int vert_opp, vert_next, vert_prev;
   54|  5.53M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  5.53M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  5.53M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 3.04M, False: 2.48M]
  |  Branch (56:35): [True: 2.37M, False: 670k]
  ------------------
   57|  2.37M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.22M, False: 157k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.22M|    const int v_opp_off = vert_opp * num_components;
   60|  2.22M|    const int v_next_off = vert_next * num_components;
   61|  2.22M|    const int v_prev_off = vert_prev * num_components;
   62|  87.9M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 85.7M, False: 2.22M]
  ------------------
   63|  85.7M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  85.7M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  85.7M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  85.7M|      const int64_t result =
   67|  85.7M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  85.7M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  85.7M|    }
   71|  2.22M|    return true;
   72|  2.22M|  }
   73|  3.31M|  return false;  // Not all data is available for prediction
   74|  5.53M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  5.53M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  5.53M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  5.53M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  5.53M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  5.53M|}

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

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

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

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     74|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    309|  bool AreCorrectionsPositive() override {
   71|    309|    return transform_.AreCorrectionsPositive();
   72|    309|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     62|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     62|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 16, False: 46]
  ------------------
   50|     16|      return false;
   51|     16|    }
   52|     46|    return true;
   53|     62|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  14.7M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     78|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    351|  bool AreCorrectionsPositive() override {
   71|    351|    return transform_.AreCorrectionsPositive();
   72|    351|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     73|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     73|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 13, False: 60]
  ------------------
   50|     13|      return false;
   51|     13|    }
   52|     60|    return true;
   53|     73|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  17.6M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  4.44k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  3.02k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  4.24k|  bool AreCorrectionsPositive() override {
   71|  4.24k|    return transform_.AreCorrectionsPositive();
   72|  4.24k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  3.27k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  3.27k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 240, False: 3.03k]
  ------------------
   50|    240|      return false;
   51|    240|    }
   52|  3.03k|    return true;
   53|  3.27k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  27.1M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    324|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    359|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    324|                                 const PointCloudDecoder *decoder) {
  188|    324|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    324|      method, att_id, decoder, TransformT());
  190|    324|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    324|                                 const TransformT &transform) {
  156|    324|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 324]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    324|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    324|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 280, False: 44]
  ------------------
  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|    280|    const MeshDecoder *const mesh_decoder =
  167|    280|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    280|    auto ret = CreateMeshPredictionScheme<
  170|    280|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    280|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    280|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    280|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 250, False: 30]
  ------------------
  174|    250|      return ret;
  175|    250|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    280|  }
  178|       |  // Create delta decoder.
  179|     74|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     74|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    324|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    145|      uint16_t bitstream_version) {
  143|    145|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    145|        method, attribute, transform, mesh_data, bitstream_version);
  145|    145|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    145|        uint16_t bitstream_version) {
  127|    145|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 135, False: 10]
  ------------------
  128|    135|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    135|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    135|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    135|                                                  mesh_data));
  132|    135|      }
  133|     10|      return nullptr;
  134|    145|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    121|      uint16_t bitstream_version) {
  143|    121|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    121|        method, attribute, transform, mesh_data, bitstream_version);
  145|    121|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    121|        uint16_t bitstream_version) {
  127|    121|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 115, False: 6]
  ------------------
  128|    115|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    115|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    115|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    115|                                                  mesh_data));
  132|    115|      }
  133|      6|      return nullptr;
  134|    121|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    359|                                 const PointCloudDecoder *decoder) {
  188|    359|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    359|      method, att_id, decoder, TransformT());
  190|    359|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    359|                                 const TransformT &transform) {
  156|    359|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 359]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    359|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    359|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 356, False: 3]
  ------------------
  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|    356|    const MeshDecoder *const mesh_decoder =
  167|    356|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    356|    auto ret = CreateMeshPredictionScheme<
  170|    356|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    356|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    356|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    356|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 281, False: 75]
  ------------------
  174|    281|      return ret;
  175|    281|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    356|  }
  178|       |  // Create delta decoder.
  179|     78|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     78|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    359|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    170|      uint16_t bitstream_version) {
  143|    170|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    170|        method, attribute, transform, mesh_data, bitstream_version);
  145|    170|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    170|        uint16_t bitstream_version) {
  111|    170|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 143, False: 27]
  ------------------
  112|    143|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    143|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    143|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    143|                                                  mesh_data));
  116|    143|      }
  117|     27|      return nullptr;
  118|    170|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    141|      uint16_t bitstream_version) {
  143|    141|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    141|        method, attribute, transform, mesh_data, bitstream_version);
  145|    141|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    141|        uint16_t bitstream_version) {
  111|    141|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 138, False: 3]
  ------------------
  112|    138|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    138|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    138|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    138|                                                  mesh_data));
  116|    138|      }
  117|      3|      return nullptr;
  118|    141|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  4.44k|                                 const PointCloudDecoder *decoder) {
  188|  4.44k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  4.44k|      method, att_id, decoder, TransformT());
  190|  4.44k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  4.44k|                                 const TransformT &transform) {
  156|  4.44k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 4.44k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  4.44k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  4.44k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 4.41k, False: 23]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|  4.41k|    const MeshDecoder *const mesh_decoder =
  167|  4.41k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  4.41k|    auto ret = CreateMeshPredictionScheme<
  170|  4.41k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  4.41k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  4.41k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  4.41k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 4.20k, False: 209]
  ------------------
  174|  4.20k|      return ret;
  175|  4.20k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  4.41k|  }
  178|       |  // Create delta decoder.
  179|    232|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    232|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  4.44k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.97k|      uint16_t bitstream_version) {
  143|  1.97k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.97k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.97k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.97k|        uint16_t bitstream_version) {
   53|  1.97k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 581, False: 1.39k]
  ------------------
   54|    581|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    581|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    581|                                                         MeshDataT>(
   57|    581|                attribute, transform, mesh_data));
   58|    581|      }
   59|  1.39k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.39k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 339, False: 1.05k]
  ------------------
   61|    339|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    339|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    339|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    339|                                                  mesh_data));
   65|    339|      }
   66|  1.05k|#endif
   67|  1.05k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 417, False: 636]
  ------------------
   68|    417|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    417|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    417|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    417|                                                  mesh_data));
   72|    417|      }
   73|    636|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    636|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 140, False: 496]
  ------------------
   75|    140|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    140|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    140|                                                     MeshDataT>(
   78|    140|                attribute, transform, mesh_data, bitstream_version));
   79|    140|      }
   80|    496|#endif
   81|    496|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 217, False: 279]
  ------------------
   82|    217|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    217|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    217|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    217|                                                  mesh_data));
   86|    217|      }
   87|    279|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    279|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 279, False: 0]
  ------------------
   89|    279|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    279|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    279|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    279|                                                  mesh_data));
   93|    279|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.97k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.23k|      uint16_t bitstream_version) {
  143|  2.23k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.23k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.23k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.23k|        uint16_t bitstream_version) {
   53|  2.23k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 569, False: 1.66k]
  ------------------
   54|    569|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    569|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    569|                                                         MeshDataT>(
   57|    569|                attribute, transform, mesh_data));
   58|    569|      }
   59|  1.66k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.66k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 409, False: 1.25k]
  ------------------
   61|    409|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    409|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    409|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    409|                                                  mesh_data));
   65|    409|      }
   66|  1.25k|#endif
   67|  1.25k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 476, False: 782]
  ------------------
   68|    476|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    476|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    476|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    476|                                                  mesh_data));
   72|    476|      }
   73|    782|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    782|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 123, False: 659]
  ------------------
   75|    123|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    123|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    123|                                                     MeshDataT>(
   78|    123|                attribute, transform, mesh_data, bitstream_version));
   79|    123|      }
   80|    659|#endif
   81|    659|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 208, False: 451]
  ------------------
   82|    208|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    208|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    208|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    208|                                                  mesh_data));
   86|    208|      }
   87|    451|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    451|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 451, False: 0]
  ------------------
   89|    451|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    451|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    451|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    451|                                                  mesh_data));
   93|    451|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.23k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    280|    uint16_t bitstream_version) {
   38|    280|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    280|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 280, False: 0]
  ------------------
   40|    280|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 8, False: 272]
  ------------------
   41|    272|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 5, False: 267]
  ------------------
   42|    267|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1, False: 266]
  ------------------
   43|    266|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 7, False: 259]
  ------------------
   44|    259|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 250, False: 9]
  ------------------
   45|    272|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 8]
  ------------------
   46|    272|    const CornerTable *const ct = source->GetCornerTable();
   47|    272|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    272|        source->GetAttributeEncodingData(att_id);
   49|    272|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 6, False: 266]
  |  Branch (49:26): [True: 0, False: 266]
  ------------------
   50|       |      // No connectivity data found.
   51|      6|      return nullptr;
   52|      6|    }
   53|       |    // Connectivity data exists.
   54|    266|    const MeshAttributeCornerTable *const att_ct =
   55|    266|        source->GetAttributeCornerTable(att_id);
   56|    266|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 145, False: 121]
  ------------------
   57|    145|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    145|      MeshData md;
   59|    145|      md.Set(source->mesh(), att_ct,
   60|    145|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    145|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    145|      MeshPredictionSchemeFactoryT factory;
   63|    145|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    145|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 135, False: 10]
  ------------------
   65|    135|        return ret;
   66|    135|      }
   67|    145|    } else {
   68|    121|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    121|      MeshData md;
   70|    121|      md.Set(source->mesh(), ct,
   71|    121|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    121|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    121|      MeshPredictionSchemeFactoryT factory;
   74|    121|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    121|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 115, False: 6]
  ------------------
   76|    115|        return ret;
   77|    115|      }
   78|    121|    }
   79|    266|  }
   80|     24|  return nullptr;
   81|    280|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    356|    uint16_t bitstream_version) {
   38|    356|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    356|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 356, False: 0]
  ------------------
   40|    356|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 26, False: 330]
  ------------------
   41|    330|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1, False: 329]
  ------------------
   42|    329|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 2, False: 327]
  ------------------
   43|    327|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 326]
  ------------------
   44|    326|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 318, False: 8]
  ------------------
   45|    349|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 7]
  ------------------
   46|    349|    const CornerTable *const ct = source->GetCornerTable();
   47|    349|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    349|        source->GetAttributeEncodingData(att_id);
   49|    349|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 38, False: 311]
  |  Branch (49:26): [True: 0, False: 311]
  ------------------
   50|       |      // No connectivity data found.
   51|     38|      return nullptr;
   52|     38|    }
   53|       |    // Connectivity data exists.
   54|    311|    const MeshAttributeCornerTable *const att_ct =
   55|    311|        source->GetAttributeCornerTable(att_id);
   56|    311|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 170, False: 141]
  ------------------
   57|    170|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    170|      MeshData md;
   59|    170|      md.Set(source->mesh(), att_ct,
   60|    170|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    170|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    170|      MeshPredictionSchemeFactoryT factory;
   63|    170|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    170|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 143, False: 27]
  ------------------
   65|    143|        return ret;
   66|    143|      }
   67|    170|    } else {
   68|    141|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    141|      MeshData md;
   70|    141|      md.Set(source->mesh(), ct,
   71|    141|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    141|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    141|      MeshPredictionSchemeFactoryT factory;
   74|    141|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    141|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 138, False: 3]
  ------------------
   76|    138|        return ret;
   77|    138|      }
   78|    141|    }
   79|    311|  }
   80|     37|  return nullptr;
   81|    356|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  4.41k|    uint16_t bitstream_version) {
   38|  4.41k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  4.41k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 4.41k, False: 0]
  ------------------
   40|  4.41k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.22k, False: 3.19k]
  ------------------
   41|  3.19k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 749, False: 2.44k]
  ------------------
   42|  2.44k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 894, False: 1.55k]
  ------------------
   43|  1.55k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 425, False: 1.12k]
  ------------------
   44|  1.12k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 737, False: 392]
  ------------------
   45|  4.28k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 263, False: 129]
  ------------------
   46|  4.28k|    const CornerTable *const ct = source->GetCornerTable();
   47|  4.28k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  4.28k|        source->GetAttributeEncodingData(att_id);
   49|  4.28k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 80, False: 4.20k]
  |  Branch (49:26): [True: 0, False: 4.20k]
  ------------------
   50|       |      // No connectivity data found.
   51|     80|      return nullptr;
   52|     80|    }
   53|       |    // Connectivity data exists.
   54|  4.20k|    const MeshAttributeCornerTable *const att_ct =
   55|  4.20k|        source->GetAttributeCornerTable(att_id);
   56|  4.20k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.97k, False: 2.23k]
  ------------------
   57|  1.97k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.97k|      MeshData md;
   59|  1.97k|      md.Set(source->mesh(), att_ct,
   60|  1.97k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.97k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.97k|      MeshPredictionSchemeFactoryT factory;
   63|  1.97k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.97k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.97k, False: 0]
  ------------------
   65|  1.97k|        return ret;
   66|  1.97k|      }
   67|  2.23k|    } else {
   68|  2.23k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.23k|      MeshData md;
   70|  2.23k|      md.Set(source->mesh(), ct,
   71|  2.23k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.23k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.23k|      MeshPredictionSchemeFactoryT factory;
   74|  2.23k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.23k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.23k, False: 0]
  ------------------
   76|  2.23k|        return ret;
   77|  2.23k|      }
   78|  2.23k|    }
   79|  4.20k|  }
   80|    129|  return nullptr;
   81|  4.41k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  17.6M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  17.6M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 17.2M, False: 389k]
  |  Branch (93:22): [True: 17.1M, False: 79.8k]
  ------------------
   94|  17.1M|      return true;
   95|  17.1M|    }
   96|   469k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 200k, False: 269k]
  |  Branch (96:25): [True: 112k, False: 88.0k]
  ------------------
   97|  17.6M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  17.6M|  int32_t GetRotationCount(Point2 pred) const {
   51|  17.6M|    const DataType sign_x = pred[0];
   52|  17.6M|    const DataType sign_y = pred[1];
   53|       |
   54|  17.6M|    int32_t rotation_count = 0;
   55|  17.6M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 17.2M, False: 389k]
  ------------------
   56|  17.2M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 17.1M, False: 79.8k]
  ------------------
   57|  17.1M|        rotation_count = 0;
   58|  17.1M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 53.1k, False: 26.6k]
  ------------------
   59|  53.1k|        rotation_count = 3;
   60|  53.1k|      } else {
   61|  26.6k|        rotation_count = 1;
   62|  26.6k|      }
   63|  17.2M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 189k, False: 200k]
  ------------------
   64|   189k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 127k, False: 61.9k]
  ------------------
   65|   127k|        rotation_count = 2;
   66|   127k|      } else {
   67|  61.9k|        rotation_count = 1;
   68|  61.9k|      }
   69|   200k|    } else {
   70|   200k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 112k, False: 88.0k]
  ------------------
   71|   112k|        rotation_count = 0;
   72|   112k|      } else {
   73|  88.0k|        rotation_count = 3;
   74|  88.0k|      }
   75|   200k|    }
   76|  17.6M|    return rotation_count;
   77|  17.6M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   714k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   714k|    switch (rotation_count) {
   81|   229k|      case 1:
  ------------------
  |  Branch (81:7): [True: 229k, False: 484k]
  ------------------
   82|   229k|        return Point2(p[1], -p[0]);
   83|   254k|      case 2:
  ------------------
  |  Branch (83:7): [True: 254k, False: 459k]
  ------------------
   84|   254k|        return Point2(-p[0], -p[1]);
   85|   229k|      case 3:
  ------------------
  |  Branch (85:7): [True: 229k, False: 484k]
  ------------------
   86|   229k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 714k]
  ------------------
   88|      0|        return p;
   89|   714k|    }
   90|   714k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    359|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

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

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

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  19.0k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  4.44k|    DecoderBuffer *buffer) {
   30|  4.44k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 226, False: 4.21k]
  ------------------
   31|    226|    return false;
   32|    226|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  4.21k|  const int32_t num_attributes = GetNumAttributes();
   35|  4.21k|  sequential_decoders_.resize(num_attributes);
   36|  20.4k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 16.2k, False: 4.18k]
  ------------------
   37|  16.2k|    uint8_t decoder_type;
   38|  16.2k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 10, False: 16.2k]
  ------------------
   39|     10|      return false;
   40|     10|    }
   41|       |    // Create the decoder from the id.
   42|  16.2k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  16.2k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 11, False: 16.2k]
  ------------------
   44|     11|      return false;
   45|     11|    }
   46|  16.2k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 7, False: 16.2k]
  ------------------
   47|      7|      return false;
   48|      7|    }
   49|  16.2k|  }
   50|  4.18k|  return true;
   51|  4.21k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  3.94k|    DecoderBuffer *buffer) {
   55|  3.94k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 3.94k]
  |  Branch (55:22): [True: 1, False: 3.94k]
  ------------------
   56|      1|    return false;
   57|      1|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  3.94k|  const int32_t num_attributes = GetNumAttributes();
   60|  19.6k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 15.7k, False: 3.94k]
  ------------------
   61|  15.7k|    PointAttribute *const pa =
   62|  15.7k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  15.7k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 15.7k]
  ------------------
   64|      0|      return false;
   65|      0|    }
   66|  15.7k|  }
   67|  3.94k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  3.94k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  3.94k|    DecoderBuffer *in_buffer) {
   72|  3.94k|  const int32_t num_attributes = GetNumAttributes();
   73|  10.9k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 8.89k, False: 2.01k]
  ------------------
   74|  8.89k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 1.93k, False: 6.96k]
  ------------------
   75|  8.89k|                                                          in_buffer)) {
   76|  1.93k|      return false;
   77|  1.93k|    }
   78|  8.89k|  }
   79|  2.01k|  return true;
   80|  3.94k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  2.01k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  2.01k|  const int32_t num_attributes = GetNumAttributes();
   85|  5.43k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 3.78k, False: 1.65k]
  ------------------
   86|  3.78k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 354, False: 3.42k]
  ------------------
   87|  3.78k|            point_ids_, in_buffer)) {
   88|    354|      return false;
   89|    354|    }
   90|  3.78k|  }
   91|  1.65k|  return true;
   92|  2.01k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.65k|    TransformAttributesToOriginalFormat() {
   96|  1.65k|  const int32_t num_attributes = GetNumAttributes();
   97|  4.43k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 3.08k, False: 1.34k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  3.08k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 3.08k, False: 0]
  ------------------
  100|  3.08k|      const PointAttribute *const attribute =
  101|  3.08k|          sequential_decoders_[i]->attribute();
  102|  3.08k|      const PointAttribute *const portable_attribute =
  103|  3.08k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  3.08k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 2.72k, False: 357]
  |  Branch (104:11): [True: 976, False: 2.10k]
  ------------------
  105|  2.72k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 976, False: 1.75k]
  ------------------
  106|  2.72k|              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|    976|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|    976|        continue;
  114|    976|      }
  115|  3.08k|    }
  116|  2.10k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 307, False: 1.80k]
  ------------------
  117|  2.10k|            point_ids_)) {
  118|    307|      return false;
  119|    307|    }
  120|  2.10k|  }
  121|  1.34k|  return true;
  122|  1.65k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  16.2k|    uint8_t decoder_type) {
  127|  16.2k|  switch (decoder_type) {
  128|  2.06k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 2.06k, False: 14.1k]
  ------------------
  129|  2.06k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  2.06k|          new SequentialAttributeDecoder());
  131|  13.1k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 13.1k, False: 3.06k]
  ------------------
  132|  13.1k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  13.1k|          new SequentialIntegerAttributeDecoder());
  134|    159|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 159, False: 16.0k]
  ------------------
  135|    159|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    159|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|    823|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 823, False: 15.4k]
  ------------------
  139|    823|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|    823|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     11|    default:
  ------------------
  |  Branch (142:5): [True: 11, False: 16.2k]
  ------------------
  143|     11|      break;
  144|  16.2k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     11|  return nullptr;
  147|  16.2k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  14.1k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  14.1k|                                             int attribute_id) {
   27|  14.1k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 14.1k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  14.1k|  return true;
   31|  14.1k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  1.75k|    const std::vector<PointIndex> &point_ids) {
   35|  1.75k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  1.75k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 1.75k, False: 0]
  ------------------
   37|  1.75k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.75k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 1.75k]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|  1.75k|#endif
   41|  1.75k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  1.75k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  8.10k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  8.10k|  int8_t prediction_scheme_method;
   48|  8.10k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 30, False: 8.07k]
  ------------------
   49|     30|    return false;
   50|     30|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  8.07k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 49, False: 8.03k]
  ------------------
   53|  8.03k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 128, False: 7.90k]
  ------------------
   54|    177|    return false;
   55|    177|  }
   56|  7.90k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 7.89k, False: 6]
  ------------------
   57|  7.89k|    int8_t prediction_transform_type;
   58|  7.89k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 30, False: 7.86k]
  ------------------
   59|     30|      return false;
   60|     30|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  7.86k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 15, False: 7.85k]
  ------------------
   63|  7.85k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 89, False: 7.76k]
  ------------------
   64|    104|      return false;
   65|    104|    }
   66|  7.76k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  7.76k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  7.76k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  7.76k|  }
   70|       |
   71|  7.76k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 5.12k, False: 2.64k]
  ------------------
   72|  5.12k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 21, False: 5.10k]
  ------------------
   73|     21|      return false;
   74|     21|    }
   75|  5.12k|  }
   76|       |
   77|  7.74k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 1.50k, False: 6.23k]
  ------------------
   78|  1.50k|    return false;
   79|  1.50k|  }
   80|       |
   81|  6.23k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  6.23k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  6.23k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 6.23k, False: 0]
  ------------------
   84|  6.23k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  6.23k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 0, False: 6.23k]
  ------------------
   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|  6.23k|#endif
   91|  6.23k|  return true;
   92|  6.23k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  7.02k|    PredictionSchemeTransformType transform_type) {
   98|  7.02k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 2.58k, False: 4.44k]
  ------------------
   99|  2.58k|    return nullptr;  // For now we support only wrap transform.
  100|  2.58k|  }
  101|  4.44k|  return CreatePredictionSchemeForDecoder<
  102|  4.44k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  4.44k|      method, attribute_id(), decoder());
  104|  7.02k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  7.74k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  7.74k|  const int num_components = GetNumValueComponents();
  109|  7.74k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 7.74k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  7.74k|  const size_t num_entries = point_ids.size();
  113|  7.74k|  const size_t num_values = num_entries * num_components;
  114|  7.74k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  7.74k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  7.74k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 7, False: 7.74k]
  ------------------
  117|      7|    return false;
  118|      7|  }
  119|  7.74k|  uint8_t compressed;
  120|  7.74k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 13, False: 7.72k]
  ------------------
  121|     13|    return false;
  122|     13|  }
  123|  7.72k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 660, False: 7.06k]
  ------------------
  124|       |    // Decode compressed values.
  125|    660|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 251, False: 409]
  ------------------
  126|    660|                       in_buffer,
  127|    660|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    251|      return false;
  129|    251|    }
  130|  7.06k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  7.06k|    uint8_t num_bytes;
  134|  7.06k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 13, False: 7.05k]
  ------------------
  135|     13|      return false;
  136|     13|    }
  137|  7.05k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 313, False: 6.74k]
  ------------------
  138|    313|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 313]
  ------------------
  139|    313|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    313|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 19, False: 294]
  ------------------
  143|    313|                             sizeof(int32_t) * num_values)) {
  144|     19|        return false;
  145|     19|      }
  146|  6.74k|    } else {
  147|  6.74k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 25, False: 6.71k]
  ------------------
  148|  6.74k|          num_bytes * num_values) {
  149|     25|        return false;
  150|     25|      }
  151|  6.71k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 19, False: 6.69k]
  ------------------
  152|  6.71k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     19|        return false;
  154|     19|      }
  155|  1.17G|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 1.17G, False: 6.69k]
  ------------------
  156|  1.17G|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 1.17G]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|  1.17G|      }
  160|  6.69k|    }
  161|  7.05k|  }
  162|       |
  163|  7.40k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 7.40k, False: 0]
  |  Branch (163:26): [True: 2.50k, False: 4.90k]
  ------------------
  164|  6.74k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 4.24k, False: 660]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  6.74k|    ConvertSymbolsToSignedInts(
  167|  6.74k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  6.74k|        static_cast<int>(num_values), portable_attribute_data);
  169|  6.74k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  7.40k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 4.90k, False: 2.50k]
  ------------------
  173|  4.90k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 666, False: 4.23k]
  ------------------
  174|    666|      return false;
  175|    666|    }
  176|       |
  177|  4.23k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 4.23k, False: 0]
  ------------------
  178|  4.23k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 496, False: 3.73k]
  ------------------
  179|  4.23k|              portable_attribute_data, portable_attribute_data,
  180|  4.23k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    496|        return false;
  182|    496|      }
  183|  4.23k|    }
  184|  4.23k|  }
  185|  6.23k|  return true;
  186|  7.40k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  1.46k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  1.46k|  switch (attribute()->data_type()) {
  190|    142|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 142, False: 1.32k]
  ------------------
  191|    142|      StoreTypedValues<uint8_t>(num_values);
  192|    142|      break;
  193|    636|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 636, False: 831]
  ------------------
  194|    636|      StoreTypedValues<int8_t>(num_values);
  195|    636|      break;
  196|    101|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 101, False: 1.36k]
  ------------------
  197|    101|      StoreTypedValues<uint16_t>(num_values);
  198|    101|      break;
  199|    236|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 236, False: 1.23k]
  ------------------
  200|    236|      StoreTypedValues<int16_t>(num_values);
  201|    236|      break;
  202|    151|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 151, False: 1.31k]
  ------------------
  203|    151|      StoreTypedValues<uint32_t>(num_values);
  204|    151|      break;
  205|     83|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 83, False: 1.38k]
  ------------------
  206|     83|      StoreTypedValues<int32_t>(num_values);
  207|     83|      break;
  208|    118|    default:
  ------------------
  |  Branch (208:5): [True: 118, False: 1.34k]
  ------------------
  209|    118|      return false;
  210|  1.46k|  }
  211|  1.34k|  return true;
  212|  1.46k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  7.74k|    int num_entries, int num_components) {
  237|  7.74k|  GeometryAttribute ga;
  238|  7.74k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  7.74k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  7.74k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  7.74k|  port_att->SetIdentityMapping();
  242|  7.74k|  port_att->Reset(num_entries);
  243|  7.74k|  port_att->set_unique_id(attribute()->unique_id());
  244|  7.74k|  SetPortableAttribute(std::move(port_att));
  245|  7.74k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    142|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    142|  const int num_components = attribute()->num_components();
  217|    142|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    142|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    142|      new AttributeTypeT[num_components]);
  220|    142|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    142|  int val_id = 0;
  222|    142|  int out_byte_pos = 0;
  223|   363k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 363k, False: 142]
  ------------------
  224|  19.3M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 19.0M, False: 363k]
  ------------------
  225|  19.0M|      const AttributeTypeT value =
  226|  19.0M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  19.0M|      att_val[c] = value;
  228|  19.0M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   363k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   363k|    out_byte_pos += entry_size;
  232|   363k|  }
  233|    142|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    636|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    636|  const int num_components = attribute()->num_components();
  217|    636|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    636|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    636|      new AttributeTypeT[num_components]);
  220|    636|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    636|  int val_id = 0;
  222|    636|  int out_byte_pos = 0;
  223|   142M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 142M, False: 636]
  ------------------
  224|   347M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 204M, False: 142M]
  ------------------
  225|   204M|      const AttributeTypeT value =
  226|   204M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   204M|      att_val[c] = value;
  228|   204M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   142M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   142M|    out_byte_pos += entry_size;
  232|   142M|  }
  233|    636|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|    101|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    101|  const int num_components = attribute()->num_components();
  217|    101|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    101|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    101|      new AttributeTypeT[num_components]);
  220|    101|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    101|  int val_id = 0;
  222|    101|  int out_byte_pos = 0;
  223|   849k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 849k, False: 101]
  ------------------
  224|  40.5M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 39.6M, False: 849k]
  ------------------
  225|  39.6M|      const AttributeTypeT value =
  226|  39.6M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  39.6M|      att_val[c] = value;
  228|  39.6M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   849k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   849k|    out_byte_pos += entry_size;
  232|   849k|  }
  233|    101|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    236|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    236|  const int num_components = attribute()->num_components();
  217|    236|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    236|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    236|      new AttributeTypeT[num_components]);
  220|    236|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    236|  int val_id = 0;
  222|    236|  int out_byte_pos = 0;
  223|  1.83M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.83M, False: 236]
  ------------------
  224|  89.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 87.5M, False: 1.83M]
  ------------------
  225|  87.5M|      const AttributeTypeT value =
  226|  87.5M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  87.5M|      att_val[c] = value;
  228|  87.5M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.83M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.83M|    out_byte_pos += entry_size;
  232|  1.83M|  }
  233|    236|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    151|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    151|  const int num_components = attribute()->num_components();
  217|    151|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    151|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    151|      new AttributeTypeT[num_components]);
  220|    151|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    151|  int val_id = 0;
  222|    151|  int out_byte_pos = 0;
  223|  1.12M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.12M, False: 151]
  ------------------
  224|   124M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 123M, False: 1.12M]
  ------------------
  225|   123M|      const AttributeTypeT value =
  226|   123M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   123M|      att_val[c] = value;
  228|   123M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.12M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.12M|    out_byte_pos += entry_size;
  232|  1.12M|  }
  233|    151|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|     83|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     83|  const int num_components = attribute()->num_components();
  217|     83|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     83|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     83|      new AttributeTypeT[num_components]);
  220|     83|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     83|  int val_id = 0;
  222|     83|  int out_byte_pos = 0;
  223|  11.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 11.0M, False: 83]
  ------------------
  224|  65.9M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 54.9M, False: 11.0M]
  ------------------
  225|  54.9M|      const AttributeTypeT value =
  226|  54.9M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  54.9M|      att_val[c] = value;
  228|  54.9M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  11.0M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  11.0M|    out_byte_pos += entry_size;
  232|  11.0M|  }
  233|     83|}

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  5.71M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  5.71M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  5.71M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  5.71M|    const int remaining = 32 - num_used_bits_;
   54|  5.71M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 4.08M, False: 1.63M]
  ------------------
   55|  4.08M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 3.70M, False: 373k]
  ------------------
   56|  3.70M|        return false;
   57|  3.70M|      }
   58|   373k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   373k|      num_used_bits_ += nbits;
   60|   373k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 12.3k, False: 361k]
  ------------------
   61|  12.3k|        ++pos_;
   62|  12.3k|        num_used_bits_ = 0;
   63|  12.3k|      }
   64|  1.63M|    } else {
   65|  1.63M|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 1.61M, False: 12.1k]
  ------------------
   66|  1.61M|        return false;
   67|  1.61M|      }
   68|  12.1k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  12.1k|      num_used_bits_ = nbits - remaining;
   70|  12.1k|      ++pos_;
   71|  12.1k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  12.1k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  12.1k|    }
   74|   386k|    return true;
   75|  5.71M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  6.52M|  bool DecodeNextBit() {
   35|  6.52M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  6.52M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 6.15M, False: 375k]
  ------------------
   37|  6.15M|      return false;
   38|  6.15M|    }
   39|   375k|    const bool bit = *pos_ & selector;
   40|   375k|    ++num_used_bits_;
   41|   375k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 11.6k, False: 364k]
  ------------------
   42|  11.6k|      ++pos_;
   43|  11.6k|      num_used_bits_ = 0;
   44|  11.6k|    }
   45|   375k|    return bit;
   46|  6.52M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    607|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    604|  FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    604|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    409|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  10.0k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 9.78k, False: 277]
  ------------------
   35|  9.78k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 132, False: 9.65k]
  ------------------
   36|    132|        return false;
   37|    132|      }
   38|  9.78k|    }
   39|    277|    return bit_decoder_.StartDecoding(source_buffer);
   40|    409|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  3.06M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  3.06M|    uint32_t result = 0;
   49|  19.4M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 16.3M, False: 3.06M]
  ------------------
   50|  16.3M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  16.3M|      result = (result << 1) + bit;
   52|  16.3M|    }
   53|  3.06M|    *value = result;
   54|  3.06M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|    119|  void EndDecoding() {
   57|  3.92k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 3.80k, False: 119]
  ------------------
   58|  3.80k|      folded_number_decoders_[i].EndDecoding();
   59|  3.80k|    }
   60|    119|    bit_decoder_.EndDecoding();
   61|    119|  }

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  53.7k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  29.0k|                                const uint8_t *const buf, int offset) {
  301|  29.0k|  unsigned x;
  302|  29.0k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 61, False: 28.9k]
  ------------------
  303|     61|    return 1;
  304|     61|  }
  305|  28.9k|  ans->buf = buf;
  306|  28.9k|  x = buf[offset - 1] >> 6;
  307|  28.9k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 25.2k, False: 3.70k]
  ------------------
  308|  25.2k|    ans->buf_offset = offset - 1;
  309|  25.2k|    ans->state = buf[offset - 1] & 0x3F;
  310|  25.2k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 3.42k, False: 279]
  ------------------
  311|  3.42k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 1, False: 3.42k]
  ------------------
  312|      1|      return 1;
  313|      1|    }
  314|  3.42k|    ans->buf_offset = offset - 2;
  315|  3.42k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  3.42k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 261, False: 18]
  ------------------
  317|    261|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 2, False: 259]
  ------------------
  318|      2|      return 1;
  319|      2|    }
  320|    259|    ans->buf_offset = offset - 3;
  321|    259|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    259|  } else {
  323|     18|    return 1;
  324|     18|  }
  325|  28.9k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  28.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  28.9k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  28.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  28.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 11, False: 28.9k]
  ------------------
  327|     11|    return 1;
  328|     11|  }
  329|  28.9k|  return 0;
  330|  28.9k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  3.42k|static uint32_t mem_get_le16(const void *vmem) {
   68|  3.42k|  uint32_t val;
   69|  3.42k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  3.42k|  val = mem[1] << 8;
   72|  3.42k|  val |= mem[0];
   73|  3.42k|  return val;
   74|  3.42k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    259|static uint32_t mem_get_le24(const void *vmem) {
   77|    259|  uint32_t val;
   78|    259|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    259|  val = mem[2] << 16;
   81|    259|  val |= mem[1] << 8;
   82|    259|  val |= mem[0];
   83|    259|  return val;
   84|    259|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  5.43G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  5.43G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  5.43G|  unsigned quot, rem, x, xn;
  172|  5.43G|#endif
  173|  5.43G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  5.43G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  5.43G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  10.8G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 4.76G, False: 672M]
  |  Branch (174:40): [True: 108k, False: 4.76G]
  ------------------
  175|   108k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   108k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   108k|  }
  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|  5.43G|  x = ans->state;
  184|  5.43G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  5.43G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  5.43G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  5.43G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  5.43G|  xn = quot * p;
  187|  5.43G|  val = rem < p;
  188|  5.43G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  10.8G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 4.77G, False: 667M]
  |  |  ------------------
  ------------------
  189|  4.77G|    ans->state = xn + rem;
  190|  4.77G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   667M|    ans->state = x - xn - p;
  193|   667M|  }
  194|  5.43G|#endif
  195|  5.43G|  return val;
  196|  5.43G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  74.4k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  74.4k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  74.4k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  74.4k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  4.95k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  484|  2.65k|                                       uint32_t num_symbols) {
  485|  2.65k|    lut_table_.resize(rans_precision);
  486|  2.65k|    probability_table_.resize(num_symbols);
  487|  2.65k|    uint32_t cum_prob = 0;
  488|  2.65k|    uint32_t act_prob = 0;
  489|  24.7k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 22.2k, False: 2.44k]
  ------------------
  490|  22.2k|      probability_table_[i].prob = token_probs[i];
  491|  22.2k|      probability_table_[i].cum_prob = cum_prob;
  492|  22.2k|      cum_prob += token_probs[i];
  493|  22.2k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 212, False: 22.0k]
  ------------------
  494|    212|        return false;
  495|    212|      }
  496|  9.06M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 9.04M, False: 22.0k]
  ------------------
  497|  9.04M|        lut_table_[j] = i;
  498|  9.04M|      }
  499|  22.0k|      act_prob = cum_prob;
  500|  22.0k|    }
  501|  2.44k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 284, False: 2.15k]
  ------------------
  502|    284|      return false;
  503|    284|    }
  504|  2.15k|    return true;
  505|  2.44k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.72k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.72k|    unsigned x;
  423|  1.72k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 137, False: 1.58k]
  ------------------
  424|    137|      return 1;
  425|    137|    }
  426|  1.58k|    ans_.buf = buf;
  427|  1.58k|    x = buf[offset - 1] >> 6;
  428|  1.58k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 989, False: 597]
  ------------------
  429|    989|      ans_.buf_offset = offset - 1;
  430|    989|      ans_.state = buf[offset - 1] & 0x3F;
  431|    989|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 210, False: 387]
  ------------------
  432|    210|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 36, False: 174]
  ------------------
  433|     36|        return 1;
  434|     36|      }
  435|    174|      ans_.buf_offset = offset - 2;
  436|    174|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    387|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 256, False: 131]
  ------------------
  438|    256|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 47, False: 209]
  ------------------
  439|     47|        return 1;
  440|     47|      }
  441|    209|      ans_.buf_offset = offset - 3;
  442|    209|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    209|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 131, False: 0]
  ------------------
  444|    131|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 35, False: 96]
  ------------------
  445|     35|        return 1;
  446|     35|      }
  447|     96|      ans_.buf_offset = offset - 4;
  448|     96|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     96|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|  1.46k|    ans_.state += l_rans_base;
  453|  1.46k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.46k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 93, False: 1.37k]
  ------------------
  454|     93|      return 1;
  455|     93|    }
  456|  1.37k|    return 0;
  457|  1.46k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    278|static uint32_t mem_get_le16(const void *vmem) {
   68|    278|  uint32_t val;
   69|    278|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    278|  val = mem[1] << 8;
   72|    278|  val |= mem[0];
   73|    278|  return val;
   74|    278|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    312|static uint32_t mem_get_le24(const void *vmem) {
   77|    312|  uint32_t val;
   78|    312|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    312|  val = mem[2] << 16;
   81|    312|  val |= mem[1] << 8;
   82|    312|  val |= mem[0];
   83|    312|  return val;
   84|    312|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    275|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    275|  uint32_t val;
   88|    275|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    275|  val = mem[3] << 24;
   91|    275|  val |= mem[2] << 16;
   92|    275|  val |= mem[1] << 8;
   93|    275|  val |= mem[0];
   94|    275|  return val;
   95|    275|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  465|  73.0M|  inline int rans_read() {
  466|  73.0M|    unsigned rem;
  467|  73.0M|    unsigned quo;
  468|  73.0M|    struct rans_dec_sym sym;
  469|  73.1M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 65.7M, False: 7.38M]
  |  Branch (469:40): [True: 25.0k, False: 65.7M]
  ------------------
  470|  25.0k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  25.0k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  25.0k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|  73.0M|    quo = ans_.state / rans_precision;
  475|  73.0M|    rem = ans_.state % rans_precision;
  476|  73.0M|    fetch_sym(&sym, rem);
  477|  73.0M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|  73.0M|    return sym.val;
  479|  73.0M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  508|  73.0M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|  73.0M|    uint32_t symbol = lut_table_[rem];
  510|  73.0M|    out->val = symbol;
  511|  73.0M|    out->prob = probability_table_[symbol].prob;
  512|  73.0M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|  73.0M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  459|  1.30k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    391|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  484|    232|                                       uint32_t num_symbols) {
  485|    232|    lut_table_.resize(rans_precision);
  486|    232|    probability_table_.resize(num_symbols);
  487|    232|    uint32_t cum_prob = 0;
  488|    232|    uint32_t act_prob = 0;
  489|  5.55k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 5.36k, False: 197]
  ------------------
  490|  5.36k|      probability_table_[i].prob = token_probs[i];
  491|  5.36k|      probability_table_[i].cum_prob = cum_prob;
  492|  5.36k|      cum_prob += token_probs[i];
  493|  5.36k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 35, False: 5.32k]
  ------------------
  494|     35|        return false;
  495|     35|      }
  496|  1.35M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 1.34M, False: 5.32k]
  ------------------
  497|  1.34M|        lut_table_[j] = i;
  498|  1.34M|      }
  499|  5.32k|      act_prob = cum_prob;
  500|  5.32k|    }
  501|    197|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 52, False: 145]
  ------------------
  502|     52|      return false;
  503|     52|    }
  504|    145|    return true;
  505|    197|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     89|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     89|    unsigned x;
  423|     89|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 86]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     86|    ans_.buf = buf;
  427|     86|    x = buf[offset - 1] >> 6;
  428|     86|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 27, False: 59]
  ------------------
  429|     27|      ans_.buf_offset = offset - 1;
  430|     27|      ans_.state = buf[offset - 1] & 0x3F;
  431|     59|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 23, False: 36]
  ------------------
  432|     23|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 22]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|     22|      ans_.buf_offset = offset - 2;
  436|     22|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     36|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 20, False: 16]
  ------------------
  438|     20|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 8, False: 12]
  ------------------
  439|      8|        return 1;
  440|      8|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     16|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 16, False: 0]
  ------------------
  444|     16|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 2, False: 14]
  ------------------
  445|      2|        return 1;
  446|      2|      }
  447|     14|      ans_.buf_offset = offset - 4;
  448|     14|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     14|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     75|    ans_.state += l_rans_base;
  453|     75|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     75|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 13, False: 62]
  ------------------
  454|     13|      return 1;
  455|     13|    }
  456|     62|    return 0;
  457|     75|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  465|   174k|  inline int rans_read() {
  466|   174k|    unsigned rem;
  467|   174k|    unsigned quo;
  468|   174k|    struct rans_dec_sym sym;
  469|   175k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 61.7k, False: 113k]
  |  Branch (469:40): [True: 1.42k, False: 60.3k]
  ------------------
  470|  1.42k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.42k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.42k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   174k|    quo = ans_.state / rans_precision;
  475|   174k|    rem = ans_.state % rans_precision;
  476|   174k|    fetch_sym(&sym, rem);
  477|   174k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   174k|    return sym.val;
  479|   174k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  508|   174k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   174k|    uint32_t symbol = lut_table_[rem];
  510|   174k|    out->val = symbol;
  511|   174k|    out->prob = probability_table_[symbol].prob;
  512|   174k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   174k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  459|     62|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    377|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  484|    204|                                       uint32_t num_symbols) {
  485|    204|    lut_table_.resize(rans_precision);
  486|    204|    probability_table_.resize(num_symbols);
  487|    204|    uint32_t cum_prob = 0;
  488|    204|    uint32_t act_prob = 0;
  489|  3.36k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 3.18k, False: 179]
  ------------------
  490|  3.18k|      probability_table_[i].prob = token_probs[i];
  491|  3.18k|      probability_table_[i].cum_prob = cum_prob;
  492|  3.18k|      cum_prob += token_probs[i];
  493|  3.18k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 25, False: 3.16k]
  ------------------
  494|     25|        return false;
  495|     25|      }
  496|  4.63M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 4.62M, False: 3.16k]
  ------------------
  497|  4.62M|        lut_table_[j] = i;
  498|  4.62M|      }
  499|  3.16k|      act_prob = cum_prob;
  500|  3.16k|    }
  501|    179|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 53, False: 126]
  ------------------
  502|     53|      return false;
  503|     53|    }
  504|    126|    return true;
  505|    179|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     81|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     81|    unsigned x;
  423|     81|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 80]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     80|    ans_.buf = buf;
  427|     80|    x = buf[offset - 1] >> 6;
  428|     80|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 24, False: 56]
  ------------------
  429|     24|      ans_.buf_offset = offset - 1;
  430|     24|      ans_.state = buf[offset - 1] & 0x3F;
  431|     56|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 14, False: 42]
  ------------------
  432|     14|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 3, False: 11]
  ------------------
  433|      3|        return 1;
  434|      3|      }
  435|     11|      ans_.buf_offset = offset - 2;
  436|     11|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     42|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 25, False: 17]
  ------------------
  438|     25|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 22]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     22|      ans_.buf_offset = offset - 3;
  442|     22|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     22|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 17, False: 0]
  ------------------
  444|     17|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 1, False: 16]
  ------------------
  445|      1|        return 1;
  446|      1|      }
  447|     16|      ans_.buf_offset = offset - 4;
  448|     16|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     16|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     73|    ans_.state += l_rans_base;
  453|     73|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     73|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 13, False: 60]
  ------------------
  454|     13|      return 1;
  455|     13|    }
  456|     60|    return 0;
  457|     73|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  465|   417k|  inline int rans_read() {
  466|   417k|    unsigned rem;
  467|   417k|    unsigned quo;
  468|   417k|    struct rans_dec_sym sym;
  469|   418k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 411k, False: 7.68k]
  |  Branch (469:40): [True: 1.16k, False: 409k]
  ------------------
  470|  1.16k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.16k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  1.16k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   417k|    quo = ans_.state / rans_precision;
  475|   417k|    rem = ans_.state % rans_precision;
  476|   417k|    fetch_sym(&sym, rem);
  477|   417k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   417k|    return sym.val;
  479|   417k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  508|   417k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   417k|    uint32_t symbol = lut_table_[rem];
  510|   417k|    out->val = symbol;
  511|   417k|    out->prob = probability_table_[symbol].prob;
  512|   417k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   417k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  459|     60|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    409|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  484|    237|                                       uint32_t num_symbols) {
  485|    237|    lut_table_.resize(rans_precision);
  486|    237|    probability_table_.resize(num_symbols);
  487|    237|    uint32_t cum_prob = 0;
  488|    237|    uint32_t act_prob = 0;
  489|  9.21k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 9.00k, False: 210]
  ------------------
  490|  9.00k|      probability_table_[i].prob = token_probs[i];
  491|  9.00k|      probability_table_[i].cum_prob = cum_prob;
  492|  9.00k|      cum_prob += token_probs[i];
  493|  9.00k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 27, False: 8.97k]
  ------------------
  494|     27|        return false;
  495|     27|      }
  496|  11.5M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 11.5M, False: 8.97k]
  ------------------
  497|  11.5M|        lut_table_[j] = i;
  498|  11.5M|      }
  499|  8.97k|      act_prob = cum_prob;
  500|  8.97k|    }
  501|    210|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 65, False: 145]
  ------------------
  502|     65|      return false;
  503|     65|    }
  504|    145|    return true;
  505|    210|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     77|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     77|    unsigned x;
  423|     77|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 10, False: 67]
  ------------------
  424|     10|      return 1;
  425|     10|    }
  426|     67|    ans_.buf = buf;
  427|     67|    x = buf[offset - 1] >> 6;
  428|     67|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 20, False: 47]
  ------------------
  429|     20|      ans_.buf_offset = offset - 1;
  430|     20|      ans_.state = buf[offset - 1] & 0x3F;
  431|     47|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 18, False: 29]
  ------------------
  432|     18|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 8]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     29|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 21, False: 8]
  ------------------
  438|     21|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 16, False: 5]
  ------------------
  439|     16|        return 1;
  440|     16|      }
  441|      5|      ans_.buf_offset = offset - 3;
  442|      5|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      8|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 8, False: 0]
  ------------------
  444|      8|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 0, False: 8]
  ------------------
  445|      0|        return 1;
  446|      0|      }
  447|      8|      ans_.buf_offset = offset - 4;
  448|      8|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|      8|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     41|    ans_.state += l_rans_base;
  453|     41|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     41|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 6, False: 35]
  ------------------
  454|      6|      return 1;
  455|      6|    }
  456|     35|    return 0;
  457|     41|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  465|  41.9k|  inline int rans_read() {
  466|  41.9k|    unsigned rem;
  467|  41.9k|    unsigned quo;
  468|  41.9k|    struct rans_dec_sym sym;
  469|  42.4k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 40.0k, False: 2.43k]
  |  Branch (469:40): [True: 534, False: 39.4k]
  ------------------
  470|    534|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    534|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    534|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|  41.9k|    quo = ans_.state / rans_precision;
  475|  41.9k|    rem = ans_.state % rans_precision;
  476|  41.9k|    fetch_sym(&sym, rem);
  477|  41.9k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|  41.9k|    return sym.val;
  479|  41.9k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  508|  41.9k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|  41.9k|    uint32_t symbol = lut_table_[rem];
  510|  41.9k|    out->val = symbol;
  511|  41.9k|    out->prob = probability_table_[symbol].prob;
  512|  41.9k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|  41.9k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  459|     35|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    410|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  484|    239|                                       uint32_t num_symbols) {
  485|    239|    lut_table_.resize(rans_precision);
  486|    239|    probability_table_.resize(num_symbols);
  487|    239|    uint32_t cum_prob = 0;
  488|    239|    uint32_t act_prob = 0;
  489|  10.7k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 10.5k, False: 204]
  ------------------
  490|  10.5k|      probability_table_[i].prob = token_probs[i];
  491|  10.5k|      probability_table_[i].cum_prob = cum_prob;
  492|  10.5k|      cum_prob += token_probs[i];
  493|  10.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 35, False: 10.5k]
  ------------------
  494|     35|        return false;
  495|     35|      }
  496|  40.8M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 40.8M, False: 10.5k]
  ------------------
  497|  40.8M|        lut_table_[j] = i;
  498|  40.8M|      }
  499|  10.5k|      act_prob = cum_prob;
  500|  10.5k|    }
  501|    204|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 59, False: 145]
  ------------------
  502|     59|      return false;
  503|     59|    }
  504|    145|    return true;
  505|    204|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     79|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     79|    unsigned x;
  423|     79|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 8, False: 71]
  ------------------
  424|      8|      return 1;
  425|      8|    }
  426|     71|    ans_.buf = buf;
  427|     71|    x = buf[offset - 1] >> 6;
  428|     71|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 18, False: 53]
  ------------------
  429|     18|      ans_.buf_offset = offset - 1;
  430|     18|      ans_.state = buf[offset - 1] & 0x3F;
  431|     53|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 6, False: 47]
  ------------------
  432|      6|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 5]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      5|      ans_.buf_offset = offset - 2;
  436|      5|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     47|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 25, False: 22]
  ------------------
  438|     25|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 8, False: 17]
  ------------------
  439|      8|        return 1;
  440|      8|      }
  441|     17|      ans_.buf_offset = offset - 3;
  442|     17|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     22|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 22, False: 0]
  ------------------
  444|     22|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 20, False: 2]
  ------------------
  445|     20|        return 1;
  446|     20|      }
  447|      2|      ans_.buf_offset = offset - 4;
  448|      2|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|      2|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     42|    ans_.state += l_rans_base;
  453|     42|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     42|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 1, False: 41]
  ------------------
  454|      1|      return 1;
  455|      1|    }
  456|     41|    return 0;
  457|     42|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  465|   105k|  inline int rans_read() {
  466|   105k|    unsigned rem;
  467|   105k|    unsigned quo;
  468|   105k|    struct rans_dec_sym sym;
  469|   105k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 62.3k, False: 43.3k]
  |  Branch (469:40): [True: 152, False: 62.1k]
  ------------------
  470|    152|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    152|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    152|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   105k|    quo = ans_.state / rans_precision;
  475|   105k|    rem = ans_.state % rans_precision;
  476|   105k|    fetch_sym(&sym, rem);
  477|   105k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   105k|    return sym.val;
  479|   105k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  508|   105k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   105k|    uint32_t symbol = lut_table_[rem];
  510|   105k|    out->val = symbol;
  511|   105k|    out->prob = probability_table_[symbol].prob;
  512|   105k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   105k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  459|     41|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    368|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  484|    208|                                       uint32_t num_symbols) {
  485|    208|    lut_table_.resize(rans_precision);
  486|    208|    probability_table_.resize(num_symbols);
  487|    208|    uint32_t cum_prob = 0;
  488|    208|    uint32_t act_prob = 0;
  489|  5.86k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 5.68k, False: 187]
  ------------------
  490|  5.68k|      probability_table_[i].prob = token_probs[i];
  491|  5.68k|      probability_table_[i].cum_prob = cum_prob;
  492|  5.68k|      cum_prob += token_probs[i];
  493|  5.68k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 21, False: 5.66k]
  ------------------
  494|     21|        return false;
  495|     21|      }
  496|  71.2M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 71.2M, False: 5.66k]
  ------------------
  497|  71.2M|        lut_table_[j] = i;
  498|  71.2M|      }
  499|  5.66k|      act_prob = cum_prob;
  500|  5.66k|    }
  501|    187|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 61, False: 126]
  ------------------
  502|     61|      return false;
  503|     61|    }
  504|    126|    return true;
  505|    187|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     73|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     73|    unsigned x;
  423|     73|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 8, False: 65]
  ------------------
  424|      8|      return 1;
  425|      8|    }
  426|     65|    ans_.buf = buf;
  427|     65|    x = buf[offset - 1] >> 6;
  428|     65|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 32, False: 33]
  ------------------
  429|     32|      ans_.buf_offset = offset - 1;
  430|     32|      ans_.state = buf[offset - 1] & 0x3F;
  431|     33|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 9, False: 24]
  ------------------
  432|      9|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 8]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     24|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 5, False: 19]
  ------------------
  438|      5|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 4]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     19|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 19, False: 0]
  ------------------
  444|     19|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 4, False: 15]
  ------------------
  445|      4|        return 1;
  446|      4|      }
  447|     15|      ans_.buf_offset = offset - 4;
  448|     15|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     15|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     59|    ans_.state += l_rans_base;
  453|     59|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     59|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 11, False: 48]
  ------------------
  454|     11|      return 1;
  455|     11|    }
  456|     48|    return 0;
  457|     59|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  465|   449k|  inline int rans_read() {
  466|   449k|    unsigned rem;
  467|   449k|    unsigned quo;
  468|   449k|    struct rans_dec_sym sym;
  469|   450k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 328k, False: 122k]
  |  Branch (469:40): [True: 985, False: 327k]
  ------------------
  470|    985|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    985|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    985|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   449k|    quo = ans_.state / rans_precision;
  475|   449k|    rem = ans_.state % rans_precision;
  476|   449k|    fetch_sym(&sym, rem);
  477|   449k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   449k|    return sym.val;
  479|   449k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  508|   449k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   449k|    uint32_t symbol = lut_table_[rem];
  510|   449k|    out->val = symbol;
  511|   449k|    out->prob = probability_table_[symbol].prob;
  512|   449k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   449k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  459|     48|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.80k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  484|    970|                                       uint32_t num_symbols) {
  485|    970|    lut_table_.resize(rans_precision);
  486|    970|    probability_table_.resize(num_symbols);
  487|    970|    uint32_t cum_prob = 0;
  488|    970|    uint32_t act_prob = 0;
  489|  23.9k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 23.0k, False: 909]
  ------------------
  490|  23.0k|      probability_table_[i].prob = token_probs[i];
  491|  23.0k|      probability_table_[i].cum_prob = cum_prob;
  492|  23.0k|      cum_prob += token_probs[i];
  493|  23.0k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 61, False: 22.9k]
  ------------------
  494|     61|        return false;
  495|     61|      }
  496|   871M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 871M, False: 22.9k]
  ------------------
  497|   871M|        lut_table_[j] = i;
  498|   871M|      }
  499|  22.9k|      act_prob = cum_prob;
  500|  22.9k|    }
  501|    909|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 107, False: 802]
  ------------------
  502|    107|      return false;
  503|    107|    }
  504|    802|    return true;
  505|    909|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    431|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    431|    unsigned x;
  423|    431|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 27, False: 404]
  ------------------
  424|     27|      return 1;
  425|     27|    }
  426|    404|    ans_.buf = buf;
  427|    404|    x = buf[offset - 1] >> 6;
  428|    404|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 94, False: 310]
  ------------------
  429|     94|      ans_.buf_offset = offset - 1;
  430|     94|      ans_.state = buf[offset - 1] & 0x3F;
  431|    310|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 87, False: 223]
  ------------------
  432|     87|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 37, False: 50]
  ------------------
  433|     37|        return 1;
  434|     37|      }
  435|     50|      ans_.buf_offset = offset - 2;
  436|     50|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    223|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 62, False: 161]
  ------------------
  438|     62|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 19, False: 43]
  ------------------
  439|     19|        return 1;
  440|     19|      }
  441|     43|      ans_.buf_offset = offset - 3;
  442|     43|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    161|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 161, False: 0]
  ------------------
  444|    161|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 37, False: 124]
  ------------------
  445|     37|        return 1;
  446|     37|      }
  447|    124|      ans_.buf_offset = offset - 4;
  448|    124|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|    124|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    311|    ans_.state += l_rans_base;
  453|    311|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    311|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 41, False: 270]
  ------------------
  454|     41|      return 1;
  455|     41|    }
  456|    270|    return 0;
  457|    311|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  465|   113M|  inline int rans_read() {
  466|   113M|    unsigned rem;
  467|   113M|    unsigned quo;
  468|   113M|    struct rans_dec_sym sym;
  469|   113M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 99.4M, False: 13.8M]
  |  Branch (469:40): [True: 4.98k, False: 99.4M]
  ------------------
  470|  4.98k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.98k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  4.98k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   113M|    quo = ans_.state / rans_precision;
  475|   113M|    rem = ans_.state % rans_precision;
  476|   113M|    fetch_sym(&sym, rem);
  477|   113M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   113M|    return sym.val;
  479|   113M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  508|   113M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  509|   113M|    uint32_t symbol = lut_table_[rem];
  510|   113M|    out->val = symbol;
  511|   113M|    out->prob = probability_table_[symbol].prob;
  512|   113M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   113M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  459|    270|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.47k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.47k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.47k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.47k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.47k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.47k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.47k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 78, False: 1.39k]
  ------------------
   67|     78|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 9, False: 69]
  ------------------
   68|      9|      return false;
   69|      9|    }
   70|       |
   71|     78|  } else
   72|  1.39k|#endif
   73|  1.39k|  {
   74|  1.39k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 40, False: 1.35k]
  ------------------
   75|     40|      return false;
   76|     40|    }
   77|  1.39k|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|  1.42k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 90, False: 1.33k]
  ------------------
   83|     90|    return false;
   84|     90|  }
   85|  1.33k|  probability_table_.resize(num_symbols_);
   86|  1.33k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 553, False: 781]
  ------------------
   87|    553|    return true;
   88|    553|  }
   89|       |  // Decode the table.
   90|  88.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 87.6k, False: 550]
  ------------------
   91|  87.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|  87.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 98, False: 87.5k]
  ------------------
   95|     98|      return false;
   96|     98|    }
   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|  87.5k|    const int token = prob_data & 3;
  102|  87.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 33.9k, False: 53.5k]
  ------------------
  103|  33.9k|      const uint32_t offset = prob_data >> 2;
  104|  33.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 101, False: 33.8k]
  ------------------
  105|    101|        return false;
  106|    101|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.03M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.00M, False: 33.8k]
  ------------------
  109|  1.00M|        probability_table_[i + j] = 0;
  110|  1.00M|      }
  111|  33.8k|      i += offset;
  112|  53.5k|    } else {
  113|  53.5k|      const int extra_bytes = token;
  114|  53.5k|      uint32_t prob = prob_data >> 2;
  115|  86.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 33.2k, False: 53.5k]
  ------------------
  116|  33.2k|        uint8_t eb;
  117|  33.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 32, False: 33.2k]
  ------------------
  118|     32|          return false;
  119|     32|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  33.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  33.2k|      }
  124|  53.5k|      probability_table_[i] = prob;
  125|  53.5k|    }
  126|  87.5k|  }
  127|    550|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 187, False: 363]
  ------------------
  128|    187|    return false;
  129|    187|  }
  130|    363|  return true;
  131|    550|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    768|    DecoderBuffer *buffer) {
  136|    768|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    768|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    768|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    768|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 43, False: 725]
  ------------------
  140|     43|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 9, False: 34]
  ------------------
  141|      9|      return false;
  142|      9|    }
  143|       |
  144|     43|  } else
  145|    725|#endif
  146|    725|  {
  147|    725|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 44, False: 681]
  ------------------
  148|     44|      return false;
  149|     44|    }
  150|    725|  }
  151|    715|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 156, False: 559]
  ------------------
  152|    156|    return false;
  153|    156|  }
  154|    559|  const uint8_t *const data_head =
  155|    559|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    559|  buffer->Advance(bytes_encoded);
  158|    559|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 160, False: 399]
  ------------------
  159|    160|    return false;
  160|    160|  }
  161|    399|  return true;
  162|    559|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    566|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  1.65M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    326|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    326|  ans_.read_end();
  167|    326|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    654|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    654|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    654|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 654]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    654|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    654|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    654|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 69, False: 585]
  ------------------
   67|     69|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 65]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     69|  } else
   72|    585|#endif
   73|    585|  {
   74|    585|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 578]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    585|  }
   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|    643|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 48, False: 595]
  ------------------
   83|     48|    return false;
   84|     48|  }
   85|    595|  probability_table_.resize(num_symbols_);
   86|    595|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 19, False: 576]
  ------------------
   87|     19|    return true;
   88|     19|  }
   89|       |  // Decode the table.
   90|  3.59M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.59M, False: 374]
  ------------------
   91|  3.59M|    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.59M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 90, False: 3.59M]
  ------------------
   95|     90|      return false;
   96|     90|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  3.59M|    const int token = prob_data & 3;
  102|  3.59M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.15M, False: 2.44M]
  ------------------
  103|  1.15M|      const uint32_t offset = prob_data >> 2;
  104|  1.15M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 79, False: 1.15M]
  ------------------
  105|     79|        return false;
  106|     79|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  36.2M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 35.0M, False: 1.15M]
  ------------------
  109|  35.0M|        probability_table_[i + j] = 0;
  110|  35.0M|      }
  111|  1.15M|      i += offset;
  112|  2.44M|    } else {
  113|  2.44M|      const int extra_bytes = token;
  114|  2.44M|      uint32_t prob = prob_data >> 2;
  115|  2.58M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 137k, False: 2.44M]
  ------------------
  116|   137k|        uint8_t eb;
  117|   137k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 33, False: 137k]
  ------------------
  118|     33|          return false;
  119|     33|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   137k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   137k|      }
  124|  2.44M|      probability_table_[i] = prob;
  125|  2.44M|    }
  126|  3.59M|  }
  127|    374|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 139, False: 235]
  ------------------
  128|    139|    return false;
  129|    139|  }
  130|    235|  return true;
  131|    374|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    254|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    235|    DecoderBuffer *buffer) {
  136|    235|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    235|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    235|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    235|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 12, False: 223]
  ------------------
  140|     12|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 11]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     12|  } else
  145|    223|#endif
  146|    223|  {
  147|    223|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 219]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    223|  }
  151|    230|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 53, False: 177]
  ------------------
  152|     53|    return false;
  153|     53|  }
  154|    177|  const uint8_t *const data_head =
  155|    177|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    177|  buffer->Advance(bytes_encoded);
  158|    177|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 20, False: 157]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|    157|  return true;
  162|    177|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  40.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    157|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    157|  ans_.read_end();
  167|    157|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    638|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    638|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    638|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 638]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    638|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    638|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    638|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 46, False: 592]
  ------------------
   67|     46|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 42]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     46|  } else
   72|    592|#endif
   73|    592|  {
   74|    592|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 581]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    592|  }
   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|    623|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 46, False: 577]
  ------------------
   83|     46|    return false;
   84|     46|  }
   85|    577|  probability_table_.resize(num_symbols_);
   86|    577|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 564]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|   587k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 587k, False: 409]
  ------------------
   91|   587k|    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|   587k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 67, False: 587k]
  ------------------
   95|     67|      return false;
   96|     67|    }
   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|   587k|    const int token = prob_data & 3;
  102|   587k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 390k, False: 197k]
  ------------------
  103|   390k|      const uint32_t offset = prob_data >> 2;
  104|   390k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 50, False: 390k]
  ------------------
  105|     50|        return false;
  106|     50|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  13.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 12.6M, False: 390k]
  ------------------
  109|  12.6M|        probability_table_[i + j] = 0;
  110|  12.6M|      }
  111|   390k|      i += offset;
  112|   390k|    } else {
  113|   197k|      const int extra_bytes = token;
  114|   197k|      uint32_t prob = prob_data >> 2;
  115|   288k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 91.4k, False: 196k]
  ------------------
  116|  91.4k|        uint8_t eb;
  117|  91.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 38, False: 91.4k]
  ------------------
  118|     38|          return false;
  119|     38|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  91.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  91.4k|      }
  124|   196k|      probability_table_[i] = prob;
  125|   196k|    }
  126|   587k|  }
  127|    409|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 36, False: 373]
  ------------------
  128|     36|    return false;
  129|     36|  }
  130|    373|  return true;
  131|    409|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    386|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    373|    DecoderBuffer *buffer) {
  136|    373|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    373|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    373|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    373|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 24, False: 349]
  ------------------
  140|     24|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 21]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     24|  } else
  145|    349|#endif
  146|    349|  {
  147|    349|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 339]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    349|  }
  151|    360|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 121, False: 239]
  ------------------
  152|    121|    return false;
  153|    121|  }
  154|    239|  const uint8_t *const data_head =
  155|    239|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    239|  buffer->Advance(bytes_encoded);
  158|    239|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 18, False: 221]
  ------------------
  159|     18|    return false;
  160|     18|  }
  161|    221|  return true;
  162|    239|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  4.82M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    221|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    221|  ans_.read_end();
  167|    221|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    454|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    454|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    454|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 454]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    454|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    454|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    454|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 43, False: 411]
  ------------------
   67|     43|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 42]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     43|  } else
   72|    411|#endif
   73|    411|  {
   74|    411|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 403]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    411|  }
   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|    445|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 18, False: 427]
  ------------------
   83|     18|    return false;
   84|     18|  }
   85|    427|  probability_table_.resize(num_symbols_);
   86|    427|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 423]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|   176k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 176k, False: 294]
  ------------------
   91|   176k|    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|   176k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 66, False: 176k]
  ------------------
   95|     66|      return false;
   96|     66|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   176k|    const int token = prob_data & 3;
  102|   176k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 74.4k, False: 101k]
  ------------------
  103|  74.4k|      const uint32_t offset = prob_data >> 2;
  104|  74.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 74.3k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.53M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.45M, False: 74.3k]
  ------------------
  109|  3.45M|        probability_table_[i + j] = 0;
  110|  3.45M|      }
  111|  74.3k|      i += offset;
  112|   101k|    } else {
  113|   101k|      const int extra_bytes = token;
  114|   101k|      uint32_t prob = prob_data >> 2;
  115|   210k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 108k, False: 101k]
  ------------------
  116|   108k|        uint8_t eb;
  117|   108k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 108k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   108k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   108k|      }
  124|   101k|      probability_table_[i] = prob;
  125|   101k|    }
  126|   176k|  }
  127|    294|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 36, False: 258]
  ------------------
  128|     36|    return false;
  129|     36|  }
  130|    258|  return true;
  131|    294|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    262|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    258|    DecoderBuffer *buffer) {
  136|    258|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    258|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    258|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    258|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 39, False: 219]
  ------------------
  140|     39|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 35]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     39|  } else
  145|    219|#endif
  146|    219|  {
  147|    219|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 218]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    219|  }
  151|    253|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 111, False: 142]
  ------------------
  152|    111|    return false;
  153|    111|  }
  154|    142|  const uint8_t *const data_head =
  155|    142|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    142|  buffer->Advance(bytes_encoded);
  158|    142|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 21, False: 121]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|    121|  return true;
  162|    142|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  4.24M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    121|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    121|  ans_.read_end();
  167|    121|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    348|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    348|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    348|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 348]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    348|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    348|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    348|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 18, False: 330]
  ------------------
   67|     18|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 16]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     18|  } else
   72|    330|#endif
   73|    330|  {
   74|    330|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 319]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    330|  }
   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|    335|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 320]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    320|  probability_table_.resize(num_symbols_);
   86|    320|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 313]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  8.12k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.93k, False: 191]
  ------------------
   91|  7.93k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  7.93k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 66, False: 7.86k]
  ------------------
   95|     66|      return false;
   96|     66|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  7.86k|    const int token = prob_data & 3;
  102|  7.86k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.86k, False: 3.99k]
  ------------------
  103|  3.86k|      const uint32_t offset = prob_data >> 2;
  104|  3.86k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 3.84k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   131k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 127k, False: 3.84k]
  ------------------
  109|   127k|        probability_table_[i + j] = 0;
  110|   127k|      }
  111|  3.84k|      i += offset;
  112|  3.99k|    } else {
  113|  3.99k|      const int extra_bytes = token;
  114|  3.99k|      uint32_t prob = prob_data >> 2;
  115|  6.52k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.55k, False: 3.96k]
  ------------------
  116|  2.55k|        uint8_t eb;
  117|  2.55k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 30, False: 2.52k]
  ------------------
  118|     30|          return false;
  119|     30|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.52k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.52k|      }
  124|  3.96k|      probability_table_[i] = prob;
  125|  3.96k|    }
  126|  7.86k|  }
  127|    191|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 175]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|    175|  return true;
  131|    191|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    182|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    175|    DecoderBuffer *buffer) {
  136|    175|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    175|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    175|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    175|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 13, False: 162]
  ------------------
  140|     13|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 11]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     13|  } else
  145|    162|#endif
  146|    162|  {
  147|    162|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 158]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    162|  }
  151|    169|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 22, False: 147]
  ------------------
  152|     22|    return false;
  153|     22|  }
  154|    147|  const uint8_t *const data_head =
  155|    147|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    147|  buffer->Advance(bytes_encoded);
  158|    147|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 122]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|    122|  return true;
  162|    147|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  1.68M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    122|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    122|  ans_.read_end();
  167|    122|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    479|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    479|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    479|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 479]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    479|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    479|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    479|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 57, False: 422]
  ------------------
   67|     57|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 56]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     57|  } else
   72|    422|#endif
   73|    422|  {
   74|    422|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 416]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    422|  }
   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|    472|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 458]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    458|  probability_table_.resize(num_symbols_);
   86|    458|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 451]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  18.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 18.3k, False: 326]
  ------------------
   91|  18.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  18.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 69, False: 18.2k]
  ------------------
   95|     69|      return false;
   96|     69|    }
   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|  18.2k|    const int token = prob_data & 3;
  102|  18.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.3k, False: 7.90k]
  ------------------
  103|  10.3k|      const uint32_t offset = prob_data >> 2;
  104|  10.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 10.3k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   313k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 303k, False: 10.3k]
  ------------------
  109|   303k|        probability_table_[i + j] = 0;
  110|   303k|      }
  111|  10.3k|      i += offset;
  112|  10.3k|    } else {
  113|  7.90k|      const int extra_bytes = token;
  114|  7.90k|      uint32_t prob = prob_data >> 2;
  115|  12.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.06k, False: 7.88k]
  ------------------
  116|  5.06k|        uint8_t eb;
  117|  5.06k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 5.03k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.03k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.03k|      }
  124|  7.88k|      probability_table_[i] = prob;
  125|  7.88k|    }
  126|  18.2k|  }
  127|    326|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 25, False: 301]
  ------------------
  128|     25|    return false;
  129|     25|  }
  130|    301|  return true;
  131|    326|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    308|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    301|    DecoderBuffer *buffer) {
  136|    301|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    301|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    301|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    301|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 44, False: 257]
  ------------------
  140|     44|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 40]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     44|  } else
  145|    257|#endif
  146|    257|  {
  147|    257|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 256]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    257|  }
  151|    296|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 101, False: 195]
  ------------------
  152|    101|    return false;
  153|    101|  }
  154|    195|  const uint8_t *const data_head =
  155|    195|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    195|  buffer->Advance(bytes_encoded);
  158|    195|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 30, False: 165]
  ------------------
  159|     30|    return false;
  160|     30|  }
  161|    165|  return true;
  162|    195|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  10.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    165|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    165|  ans_.read_end();
  167|    165|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    423|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    423|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    423|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 423]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    423|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    423|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    423|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 40, False: 383]
  ------------------
   67|     40|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 37]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     40|  } else
   72|    383|#endif
   73|    383|  {
   74|    383|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 376]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    383|  }
   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|    413|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 18, False: 395]
  ------------------
   83|     18|    return false;
   84|     18|  }
   85|    395|  probability_table_.resize(num_symbols_);
   86|    395|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 15, False: 380]
  ------------------
   87|     15|    return true;
   88|     15|  }
   89|       |  // Decode the table.
   90|   962k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 962k, False: 234]
  ------------------
   91|   962k|    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|   962k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 78, False: 962k]
  ------------------
   95|     78|      return false;
   96|     78|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   962k|    const int token = prob_data & 3;
  102|   962k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 353k, False: 608k]
  ------------------
  103|   353k|      const uint32_t offset = prob_data >> 2;
  104|   353k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 353k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  12.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 12.5M, False: 353k]
  ------------------
  109|  12.5M|        probability_table_[i + j] = 0;
  110|  12.5M|      }
  111|   353k|      i += offset;
  112|   608k|    } else {
  113|   608k|      const int extra_bytes = token;
  114|   608k|      uint32_t prob = prob_data >> 2;
  115|  1.02M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 418k, False: 608k]
  ------------------
  116|   418k|        uint8_t eb;
  117|   418k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 35, False: 418k]
  ------------------
  118|     35|          return false;
  119|     35|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   418k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   418k|      }
  124|   608k|      probability_table_[i] = prob;
  125|   608k|    }
  126|   962k|  }
  127|    234|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 211]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    211|  return true;
  131|    234|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    226|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    211|    DecoderBuffer *buffer) {
  136|    211|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    211|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    211|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    211|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 26, False: 185]
  ------------------
  140|     26|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 21]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     26|  } else
  145|    185|#endif
  146|    185|  {
  147|    185|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 183]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    185|  }
  151|    204|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 79, False: 125]
  ------------------
  152|     79|    return false;
  153|     79|  }
  154|    125|  const uint8_t *const data_head =
  155|    125|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    125|  buffer->Advance(bytes_encoded);
  158|    125|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 92]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     92|  return true;
  162|    125|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  6.98M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     92|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     92|  ans_.read_end();
  167|     92|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    481|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    481|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    481|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 481]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    481|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    481|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    481|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 59, False: 422]
  ------------------
   67|     59|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 55]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     59|  } else
   72|    422|#endif
   73|    422|  {
   74|    422|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 21, False: 401]
  ------------------
   75|     21|      return false;
   76|     21|    }
   77|    422|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    456|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 27, False: 429]
  ------------------
   83|     27|    return false;
   84|     27|  }
   85|    429|  probability_table_.resize(num_symbols_);
   86|    429|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 418]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   328k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 328k, False: 277]
  ------------------
   91|   328k|    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|   328k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 74, False: 328k]
  ------------------
   95|     74|      return false;
   96|     74|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   328k|    const int token = prob_data & 3;
  102|   328k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 86.0k, False: 242k]
  ------------------
  103|  86.0k|      const uint32_t offset = prob_data >> 2;
  104|  86.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 86.0k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.85M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.76M, False: 86.0k]
  ------------------
  109|  2.76M|        probability_table_[i + j] = 0;
  110|  2.76M|      }
  111|  86.0k|      i += offset;
  112|   242k|    } else {
  113|   242k|      const int extra_bytes = token;
  114|   242k|      uint32_t prob = prob_data >> 2;
  115|   361k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 119k, False: 241k]
  ------------------
  116|   119k|        uint8_t eb;
  117|   119k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 119k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   119k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   119k|      }
  124|   241k|      probability_table_[i] = prob;
  125|   241k|    }
  126|   328k|  }
  127|    277|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 34, False: 243]
  ------------------
  128|     34|    return false;
  129|     34|  }
  130|    243|  return true;
  131|    277|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    254|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    243|    DecoderBuffer *buffer) {
  136|    243|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    243|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    243|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    243|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 44, False: 199]
  ------------------
  140|     44|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 43]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     44|  } else
  145|    199|#endif
  146|    199|  {
  147|    199|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 197]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    199|  }
  151|    240|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 101, False: 139]
  ------------------
  152|    101|    return false;
  153|    101|  }
  154|    139|  const uint8_t *const data_head =
  155|    139|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    139|  buffer->Advance(bytes_encoded);
  158|    139|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 41, False: 98]
  ------------------
  159|     41|    return false;
  160|     41|  }
  161|     98|  return true;
  162|    139|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  2.84M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     98|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     98|  ans_.read_end();
  167|     98|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    391|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    391|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    391|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 391]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    391|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    391|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    391|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 19, False: 372]
  ------------------
   67|     19|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 18]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     19|  } else
   72|    372|#endif
   73|    372|  {
   74|    372|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 367]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    372|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    385|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 368]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    368|  probability_table_.resize(num_symbols_);
   86|    368|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 359]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  23.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 23.0k, False: 232]
  ------------------
   91|  23.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|  23.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 58, False: 23.0k]
  ------------------
   95|     58|      return false;
   96|     58|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  23.0k|    const int token = prob_data & 3;
  102|  23.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 15.3k, False: 7.69k]
  ------------------
  103|  15.3k|      const uint32_t offset = prob_data >> 2;
  104|  15.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 41, False: 15.2k]
  ------------------
  105|     41|        return false;
  106|     41|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   369k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 354k, False: 15.2k]
  ------------------
  109|   354k|        probability_table_[i + j] = 0;
  110|   354k|      }
  111|  15.2k|      i += offset;
  112|  15.2k|    } else {
  113|  7.69k|      const int extra_bytes = token;
  114|  7.69k|      uint32_t prob = prob_data >> 2;
  115|  13.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.25k, False: 7.66k]
  ------------------
  116|  6.25k|        uint8_t eb;
  117|  6.25k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 6.22k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.22k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.22k|      }
  124|  7.66k|      probability_table_[i] = prob;
  125|  7.66k|    }
  126|  23.0k|  }
  127|    232|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 87, False: 145]
  ------------------
  128|     87|    return false;
  129|     87|  }
  130|    145|  return true;
  131|    232|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    154|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    145|    DecoderBuffer *buffer) {
  136|    145|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    145|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    145|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    145|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 145]
  ------------------
  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|    145|#endif
  146|    145|  {
  147|    145|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 143]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    145|  }
  151|    143|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 54, False: 89]
  ------------------
  152|     54|    return false;
  153|     54|  }
  154|     89|  const uint8_t *const data_head =
  155|     89|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     89|  buffer->Advance(bytes_encoded);
  158|     89|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 62]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|     62|  return true;
  162|     89|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   174k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     62|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     62|  ans_.read_end();
  167|     62|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    377|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    377|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    377|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 377]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    377|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    377|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    377|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 362]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 14]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     15|  } else
   72|    362|#endif
   73|    362|  {
   74|    362|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 361]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    362|  }
   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|    375|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 352]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    352|  probability_table_.resize(num_symbols_);
   86|    352|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 347]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   384k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 383k, False: 204]
  ------------------
   91|   383k|    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|   383k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 70, False: 383k]
  ------------------
   95|     70|      return false;
   96|     70|    }
   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|   383k|    const int token = prob_data & 3;
  102|   383k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 64.5k, False: 319k]
  ------------------
  103|  64.5k|      const uint32_t offset = prob_data >> 2;
  104|  64.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 43, False: 64.5k]
  ------------------
  105|     43|        return false;
  106|     43|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.21M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.14M, False: 64.5k]
  ------------------
  109|  2.14M|        probability_table_[i + j] = 0;
  110|  2.14M|      }
  111|  64.5k|      i += offset;
  112|   319k|    } else {
  113|   319k|      const int extra_bytes = token;
  114|   319k|      uint32_t prob = prob_data >> 2;
  115|   549k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 229k, False: 319k]
  ------------------
  116|   229k|        uint8_t eb;
  117|   229k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 30, False: 229k]
  ------------------
  118|     30|          return false;
  119|     30|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   229k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   229k|      }
  124|   319k|      probability_table_[i] = prob;
  125|   319k|    }
  126|   383k|  }
  127|    204|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 78, False: 126]
  ------------------
  128|     78|    return false;
  129|     78|  }
  130|    126|  return true;
  131|    204|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    131|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    126|    DecoderBuffer *buffer) {
  136|    126|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    126|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    126|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    126|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 126]
  ------------------
  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|    126|#endif
  146|    126|  {
  147|    126|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 125]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    126|  }
  151|    125|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 44, False: 81]
  ------------------
  152|     44|    return false;
  153|     44|  }
  154|     81|  const uint8_t *const data_head =
  155|     81|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     81|  buffer->Advance(bytes_encoded);
  158|     81|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 21, False: 60]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|     60|  return true;
  162|     81|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   417k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     60|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     60|  ans_.read_end();
  167|     60|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    409|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    409|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    409|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 409]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    409|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    409|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    409|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 41, False: 368]
  ------------------
   67|     41|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 40]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     41|  } else
   72|    368|#endif
   73|    368|  {
   74|    368|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 366]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    368|  }
   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|    406|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 385]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    385|  probability_table_.resize(num_symbols_);
   86|    385|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 377]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|   101k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 101k, False: 237]
  ------------------
   91|   101k|    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|   101k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 54, False: 101k]
  ------------------
   95|     54|      return false;
   96|     54|    }
   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|   101k|    const int token = prob_data & 3;
  102|   101k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 23.4k, False: 78.0k]
  ------------------
  103|  23.4k|      const uint32_t offset = prob_data >> 2;
  104|  23.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 59, False: 23.4k]
  ------------------
  105|     59|        return false;
  106|     59|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   771k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 748k, False: 23.4k]
  ------------------
  109|   748k|        probability_table_[i + j] = 0;
  110|   748k|      }
  111|  23.4k|      i += offset;
  112|  78.0k|    } else {
  113|  78.0k|      const int extra_bytes = token;
  114|  78.0k|      uint32_t prob = prob_data >> 2;
  115|   142k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 64.1k, False: 78.0k]
  ------------------
  116|  64.1k|        uint8_t eb;
  117|  64.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 64.0k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  64.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  64.0k|      }
  124|  78.0k|      probability_table_[i] = prob;
  125|  78.0k|    }
  126|   101k|  }
  127|    237|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 92, False: 145]
  ------------------
  128|     92|    return false;
  129|     92|  }
  130|    145|  return true;
  131|    237|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    153|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    145|    DecoderBuffer *buffer) {
  136|    145|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    145|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    145|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    145|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 145]
  ------------------
  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|    145|#endif
  146|    145|  {
  147|    145|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 142]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    145|  }
  151|    142|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 65, False: 77]
  ------------------
  152|     65|    return false;
  153|     65|  }
  154|     77|  const uint8_t *const data_head =
  155|     77|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     77|  buffer->Advance(bytes_encoded);
  158|     77|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 42, False: 35]
  ------------------
  159|     42|    return false;
  160|     42|  }
  161|     35|  return true;
  162|     77|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  41.9k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     35|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     35|  ans_.read_end();
  167|     35|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    410|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    410|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    410|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 410]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    410|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    410|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    410|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 9, False: 401]
  ------------------
   67|      9|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 8]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|      9|  } else
   72|    401|#endif
   73|    401|  {
   74|    401|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 388]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    401|  }
   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|    396|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 384]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    384|  probability_table_.resize(num_symbols_);
   86|    384|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 376]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  23.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 23.1k, False: 239]
  ------------------
   91|  23.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  23.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 73, False: 23.0k]
  ------------------
   95|     73|      return false;
   96|     73|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  23.0k|    const int token = prob_data & 3;
  102|  23.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.67k, False: 15.3k]
  ------------------
  103|  7.67k|      const uint32_t offset = prob_data >> 2;
  104|  7.67k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 40, False: 7.63k]
  ------------------
  105|     40|        return false;
  106|     40|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   229k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 221k, False: 7.63k]
  ------------------
  109|   221k|        probability_table_[i + j] = 0;
  110|   221k|      }
  111|  7.63k|      i += offset;
  112|  15.3k|    } else {
  113|  15.3k|      const int extra_bytes = token;
  114|  15.3k|      uint32_t prob = prob_data >> 2;
  115|  21.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.71k, False: 15.3k]
  ------------------
  116|  5.71k|        uint8_t eb;
  117|  5.71k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 5.69k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.69k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.69k|      }
  124|  15.3k|      probability_table_[i] = prob;
  125|  15.3k|    }
  126|  23.0k|  }
  127|    239|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 94, False: 145]
  ------------------
  128|     94|    return false;
  129|     94|  }
  130|    145|  return true;
  131|    239|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    153|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    145|    DecoderBuffer *buffer) {
  136|    145|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    145|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    145|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    145|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 145]
  ------------------
  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|    145|#endif
  146|    145|  {
  147|    145|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 142]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    145|  }
  151|    142|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 63, False: 79]
  ------------------
  152|     63|    return false;
  153|     63|  }
  154|     79|  const uint8_t *const data_head =
  155|     79|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     79|  buffer->Advance(bytes_encoded);
  158|     79|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 41]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|     41|  return true;
  162|     79|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   105k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     41|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     41|  ans_.read_end();
  167|     41|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    368|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    368|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    368|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 368]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    368|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    368|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    368|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 16, False: 352]
  ------------------
   67|     16|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 14]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     16|  } else
   72|    352|#endif
   73|    352|  {
   74|    352|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 349]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    352|  }
   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|    363|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 354]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    354|  probability_table_.resize(num_symbols_);
   86|    354|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 344]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  26.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 26.6k, False: 208]
  ------------------
   91|  26.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|  26.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 70, False: 26.5k]
  ------------------
   95|     70|      return false;
   96|     70|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  26.5k|    const int token = prob_data & 3;
  102|  26.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.35k, False: 19.2k]
  ------------------
  103|  7.35k|      const uint32_t offset = prob_data >> 2;
  104|  7.35k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 7.31k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   233k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 225k, False: 7.31k]
  ------------------
  109|   225k|        probability_table_[i + j] = 0;
  110|   225k|      }
  111|  7.31k|      i += offset;
  112|  19.2k|    } else {
  113|  19.2k|      const int extra_bytes = token;
  114|  19.2k|      uint32_t prob = prob_data >> 2;
  115|  29.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 9.82k, False: 19.1k]
  ------------------
  116|  9.82k|        uint8_t eb;
  117|  9.82k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 9.79k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  9.79k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  9.79k|      }
  124|  19.1k|      probability_table_[i] = prob;
  125|  19.1k|    }
  126|  26.5k|  }
  127|    208|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 82, False: 126]
  ------------------
  128|     82|    return false;
  129|     82|  }
  130|    126|  return true;
  131|    208|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    136|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    126|    DecoderBuffer *buffer) {
  136|    126|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    126|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    126|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    126|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 126]
  ------------------
  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|    126|#endif
  146|    126|  {
  147|    126|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 122]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    126|  }
  151|    122|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 49, False: 73]
  ------------------
  152|     49|    return false;
  153|     49|  }
  154|     73|  const uint8_t *const data_head =
  155|     73|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     73|  buffer->Advance(bytes_encoded);
  158|     73|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 48]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     48|  return true;
  162|     73|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   449k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     48|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     48|  ans_.read_end();
  167|     48|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    365|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    365|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    365|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 365]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    365|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    365|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    365|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 39, False: 326]
  ------------------
   67|     39|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 38]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     39|  } else
   72|    326|#endif
   73|    326|  {
   74|    326|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 320]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    326|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    358|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 36, False: 322]
  ------------------
   83|     36|    return false;
   84|     36|  }
   85|    322|  probability_table_.resize(num_symbols_);
   86|    322|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 314]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  92.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 92.2k, False: 182]
  ------------------
   91|  92.2k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  92.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 70, False: 92.1k]
  ------------------
   95|     70|      return false;
   96|     70|    }
   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|  92.1k|    const int token = prob_data & 3;
  102|  92.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 52.1k, False: 39.9k]
  ------------------
  103|  52.1k|      const uint32_t offset = prob_data >> 2;
  104|  52.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 52.1k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.26M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.20M, False: 52.1k]
  ------------------
  109|  2.20M|        probability_table_[i + j] = 0;
  110|  2.20M|      }
  111|  52.1k|      i += offset;
  112|  52.1k|    } else {
  113|  39.9k|      const int extra_bytes = token;
  114|  39.9k|      uint32_t prob = prob_data >> 2;
  115|  62.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 22.8k, False: 39.9k]
  ------------------
  116|  22.8k|        uint8_t eb;
  117|  22.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 30, False: 22.8k]
  ------------------
  118|     30|          return false;
  119|     30|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  22.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  22.8k|      }
  124|  39.9k|      probability_table_[i] = prob;
  125|  39.9k|    }
  126|  92.1k|  }
  127|    182|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 46, False: 136]
  ------------------
  128|     46|    return false;
  129|     46|  }
  130|    136|  return true;
  131|    182|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    144|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    136|    DecoderBuffer *buffer) {
  136|    136|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    136|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    136|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    136|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 134]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 1]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      2|  } else
  145|    134|#endif
  146|    134|  {
  147|    134|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 127]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    134|  }
  151|    128|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 50, False: 78]
  ------------------
  152|     50|    return false;
  153|     50|  }
  154|     78|  const uint8_t *const data_head =
  155|     78|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     78|  buffer->Advance(bytes_encoded);
  158|     78|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 44, False: 34]
  ------------------
  159|     44|    return false;
  160|     44|  }
  161|     34|  return true;
  162|     78|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  3.45M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     34|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     34|  ans_.read_end();
  167|     34|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    346|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    346|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    346|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 346]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    346|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    346|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    346|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 35, False: 311]
  ------------------
   67|     35|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 34]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     35|  } else
   72|    311|#endif
   73|    311|  {
   74|    311|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 308]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    311|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    342|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 330]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    330|  probability_table_.resize(num_symbols_);
   86|    330|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 15, False: 315]
  ------------------
   87|     15|    return true;
   88|     15|  }
   89|       |  // Decode the table.
   90|  13.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 13.3k, False: 199]
  ------------------
   91|  13.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  13.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 57, False: 13.2k]
  ------------------
   95|     57|      return false;
   96|     57|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  13.2k|    const int token = prob_data & 3;
  102|  13.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.25k, False: 9.03k]
  ------------------
  103|  4.25k|      const uint32_t offset = prob_data >> 2;
  104|  4.25k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 4.22k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   147k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 142k, False: 4.22k]
  ------------------
  109|   142k|        probability_table_[i + j] = 0;
  110|   142k|      }
  111|  4.22k|      i += offset;
  112|  9.03k|    } else {
  113|  9.03k|      const int extra_bytes = token;
  114|  9.03k|      uint32_t prob = prob_data >> 2;
  115|  15.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.41k, False: 9.00k]
  ------------------
  116|  6.41k|        uint8_t eb;
  117|  6.41k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 6.38k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.38k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.38k|      }
  124|  9.00k|      probability_table_[i] = prob;
  125|  9.00k|    }
  126|  13.2k|  }
  127|    199|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 42, False: 157]
  ------------------
  128|     42|    return false;
  129|     42|  }
  130|    157|  return true;
  131|    199|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    172|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    157|    DecoderBuffer *buffer) {
  136|    157|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    157|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    157|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    157|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 130]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 26]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     27|  } else
  145|    130|#endif
  146|    130|  {
  147|    130|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 120]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    130|  }
  151|    146|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 48, False: 98]
  ------------------
  152|     48|    return false;
  153|     48|  }
  154|     98|  const uint8_t *const data_head =
  155|     98|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     98|  buffer->Advance(bytes_encoded);
  158|     98|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 44, False: 54]
  ------------------
  159|     44|    return false;
  160|     44|  }
  161|     54|  return true;
  162|     98|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  6.64M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     54|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     54|  ans_.read_end();
  167|     54|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    361|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    361|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    361|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 361]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    361|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    361|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    361|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 323]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 35]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     38|  } else
   72|    323|#endif
   73|    323|  {
   74|    323|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 313]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    323|  }
   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|    348|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 329]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    329|  probability_table_.resize(num_symbols_);
   86|    329|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 328]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  19.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 19.6k, False: 205]
  ------------------
   91|  19.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|  19.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 59, False: 19.5k]
  ------------------
   95|     59|      return false;
   96|     59|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  19.5k|    const int token = prob_data & 3;
  102|  19.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.33k, False: 12.2k]
  ------------------
  103|  7.33k|      const uint32_t offset = prob_data >> 2;
  104|  7.33k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 7.30k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   278k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 271k, False: 7.30k]
  ------------------
  109|   271k|        probability_table_[i + j] = 0;
  110|   271k|      }
  111|  7.30k|      i += offset;
  112|  12.2k|    } else {
  113|  12.2k|      const int extra_bytes = token;
  114|  12.2k|      uint32_t prob = prob_data >> 2;
  115|  24.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 12.5k, False: 12.2k]
  ------------------
  116|  12.5k|        uint8_t eb;
  117|  12.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 34, False: 12.5k]
  ------------------
  118|     34|          return false;
  119|     34|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  12.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  12.5k|      }
  124|  12.2k|      probability_table_[i] = prob;
  125|  12.2k|    }
  126|  19.5k|  }
  127|    205|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 27, False: 178]
  ------------------
  128|     27|    return false;
  129|     27|  }
  130|    178|  return true;
  131|    205|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    179|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    178|    DecoderBuffer *buffer) {
  136|    178|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    178|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    178|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    178|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 25, False: 153]
  ------------------
  140|     25|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 23]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     25|  } else
  145|    153|#endif
  146|    153|  {
  147|    153|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 14, False: 139]
  ------------------
  148|     14|      return false;
  149|     14|    }
  150|    153|  }
  151|    162|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 64, False: 98]
  ------------------
  152|     64|    return false;
  153|     64|  }
  154|     98|  const uint8_t *const data_head =
  155|     98|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     98|  buffer->Advance(bytes_encoded);
  158|     98|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 31, False: 67]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|     67|  return true;
  162|     98|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  27.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     67|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     67|  ans_.read_end();
  167|     67|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    375|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    375|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    375|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 375]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    375|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    375|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    375|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 333]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 41]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     42|  } else
   72|    333|#endif
   73|    333|  {
   74|    333|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 328]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    333|  }
   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|    369|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 349]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    349|  probability_table_.resize(num_symbols_);
   86|    349|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 335]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|  9.70k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.51k, False: 195]
  ------------------
   91|  9.51k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  9.51k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 83, False: 9.42k]
  ------------------
   95|     83|      return false;
   96|     83|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  9.42k|    const int token = prob_data & 3;
  102|  9.42k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.98k, False: 6.43k]
  ------------------
  103|  2.98k|      const uint32_t offset = prob_data >> 2;
  104|  2.98k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 2.95k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   103k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 100k, False: 2.95k]
  ------------------
  109|   100k|        probability_table_[i + j] = 0;
  110|   100k|      }
  111|  2.95k|      i += offset;
  112|  6.43k|    } else {
  113|  6.43k|      const int extra_bytes = token;
  114|  6.43k|      uint32_t prob = prob_data >> 2;
  115|  11.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.88k, False: 6.41k]
  ------------------
  116|  4.88k|        uint8_t eb;
  117|  4.88k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 4.86k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.86k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.86k|      }
  124|  6.41k|      probability_table_[i] = prob;
  125|  6.41k|    }
  126|  9.42k|  }
  127|    195|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 22, False: 173]
  ------------------
  128|     22|    return false;
  129|     22|  }
  130|    173|  return true;
  131|    195|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    187|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    173|    DecoderBuffer *buffer) {
  136|    173|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    173|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    173|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    173|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 33, False: 140]
  ------------------
  140|     33|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 30]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     33|  } else
  145|    140|#endif
  146|    140|  {
  147|    140|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 137]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    140|  }
  151|    167|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 77, False: 90]
  ------------------
  152|     77|    return false;
  153|     77|  }
  154|     90|  const uint8_t *const data_head =
  155|     90|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     90|  buffer->Advance(bytes_encoded);
  158|     90|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 57]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     57|  return true;
  162|     90|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  28.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     57|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     57|  ans_.read_end();
  167|     57|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    354|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    354|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    354|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 354]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    354|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    354|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    354|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 84, False: 270]
  ------------------
   67|     84|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 82]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     84|  } else
   72|    270|#endif
   73|    270|  {
   74|    270|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 14, False: 256]
  ------------------
   75|     14|      return false;
   76|     14|    }
   77|    270|  }
   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|    338|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 22, False: 316]
  ------------------
   83|     22|    return false;
   84|     22|  }
   85|    316|  probability_table_.resize(num_symbols_);
   86|    316|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 314]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  64.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 64.0k, False: 189]
  ------------------
   91|  64.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|  64.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 76, False: 63.9k]
  ------------------
   95|     76|      return false;
   96|     76|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  63.9k|    const int token = prob_data & 3;
  102|  63.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 47.5k, False: 16.4k]
  ------------------
  103|  47.5k|      const uint32_t offset = prob_data >> 2;
  104|  47.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 47.5k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   445k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 398k, False: 47.5k]
  ------------------
  109|   398k|        probability_table_[i + j] = 0;
  110|   398k|      }
  111|  47.5k|      i += offset;
  112|  47.5k|    } else {
  113|  16.4k|      const int extra_bytes = token;
  114|  16.4k|      uint32_t prob = prob_data >> 2;
  115|  36.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 19.7k, False: 16.4k]
  ------------------
  116|  19.7k|        uint8_t eb;
  117|  19.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 19.7k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  19.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  19.7k|      }
  124|  16.4k|      probability_table_[i] = prob;
  125|  16.4k|    }
  126|  63.9k|  }
  127|    189|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 31, False: 158]
  ------------------
  128|     31|    return false;
  129|     31|  }
  130|    158|  return true;
  131|    189|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    160|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    158|    DecoderBuffer *buffer) {
  136|    158|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    158|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    158|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    158|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 70, False: 88]
  ------------------
  140|     70|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 69]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     70|  } else
  145|     88|#endif
  146|     88|  {
  147|     88|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 85]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     88|  }
  151|    154|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 87, False: 67]
  ------------------
  152|     87|    return false;
  153|     87|  }
  154|     67|  const uint8_t *const data_head =
  155|     67|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     67|  buffer->Advance(bytes_encoded);
  158|     67|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 9, False: 58]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     58|  return true;
  162|     67|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  47.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  11.6k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  11.6k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 24, False: 11.6k]
  ------------------
   35|     24|    return true;
   36|     24|  }
   37|       |  // Decode which scheme to use.
   38|  11.6k|  uint8_t scheme;
   39|  11.6k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 153, False: 11.4k]
  ------------------
   40|    153|    return false;
   41|    153|  }
   42|  11.4k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.19k, False: 10.2k]
  ------------------
   43|  1.19k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.19k|                                                  src_buffer, out_values);
   45|  10.2k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 7.85k, False: 2.41k]
  ------------------
   46|  7.85k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  7.85k|                                               out_values);
   48|  7.85k|  }
   49|  2.41k|  return false;
   50|  11.4k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.19k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.19k|  SymbolDecoderT<5> tag_decoder;
   57|  1.19k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 518, False: 675]
  ------------------
   58|    518|    return false;
   59|    518|  }
   60|       |
   61|    675|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 350, False: 325]
  ------------------
   62|    350|    return false;
   63|    350|  }
   64|       |
   65|    325|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 325, False: 0]
  |  Branch (65:25): [True: 73, False: 252]
  ------------------
   66|     73|    return false;  // Wrong number of symbols.
   67|     73|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    252|  src_buffer->StartBitDecoding(false, nullptr);
   72|    252|  int value_id = 0;
   73|   988k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 988k, False: 252]
  ------------------
   74|       |    // Decode the tag.
   75|   988k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  2.50M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 1.51M, False: 988k]
  ------------------
   78|  1.51M|      uint32_t val;
   79|  1.51M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 1.51M]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|  1.51M|      out_values[value_id++] = val;
   83|  1.51M|    }
   84|   988k|  }
   85|    252|  tag_decoder.EndDecoding();
   86|    252|  src_buffer->EndBitDecoding();
   87|    252|  return true;
   88|    252|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  7.85k|                      uint32_t *out_values) {
  117|  7.85k|  uint8_t max_bit_length;
  118|  7.85k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 35, False: 7.82k]
  ------------------
  119|     35|    return false;
  120|     35|  }
  121|  7.82k|  switch (max_bit_length) {
  122|    654|    case 1:
  ------------------
  |  Branch (122:5): [True: 654, False: 7.16k]
  ------------------
  123|    654|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    654|                                                         out_values);
  125|    638|    case 2:
  ------------------
  |  Branch (125:5): [True: 638, False: 7.18k]
  ------------------
  126|    638|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    638|                                                         out_values);
  128|    454|    case 3:
  ------------------
  |  Branch (128:5): [True: 454, False: 7.36k]
  ------------------
  129|    454|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    454|                                                         out_values);
  131|    348|    case 4:
  ------------------
  |  Branch (131:5): [True: 348, False: 7.47k]
  ------------------
  132|    348|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    348|                                                         out_values);
  134|    280|    case 5:
  ------------------
  |  Branch (134:5): [True: 280, False: 7.54k]
  ------------------
  135|    280|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    280|                                                         out_values);
  137|    479|    case 6:
  ------------------
  |  Branch (137:5): [True: 479, False: 7.34k]
  ------------------
  138|    479|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    479|                                                         out_values);
  140|    423|    case 7:
  ------------------
  |  Branch (140:5): [True: 423, False: 7.39k]
  ------------------
  141|    423|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    423|                                                         out_values);
  143|    481|    case 8:
  ------------------
  |  Branch (143:5): [True: 481, False: 7.34k]
  ------------------
  144|    481|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    481|                                                         out_values);
  146|    391|    case 9:
  ------------------
  |  Branch (146:5): [True: 391, False: 7.43k]
  ------------------
  147|    391|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    391|                                                         out_values);
  149|    377|    case 10:
  ------------------
  |  Branch (149:5): [True: 377, False: 7.44k]
  ------------------
  150|    377|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    377|          num_values, src_buffer, out_values);
  152|    409|    case 11:
  ------------------
  |  Branch (152:5): [True: 409, False: 7.41k]
  ------------------
  153|    409|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    409|          num_values, src_buffer, out_values);
  155|    410|    case 12:
  ------------------
  |  Branch (155:5): [True: 410, False: 7.41k]
  ------------------
  156|    410|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    410|          num_values, src_buffer, out_values);
  158|    368|    case 13:
  ------------------
  |  Branch (158:5): [True: 368, False: 7.45k]
  ------------------
  159|    368|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    368|          num_values, src_buffer, out_values);
  161|    365|    case 14:
  ------------------
  |  Branch (161:5): [True: 365, False: 7.45k]
  ------------------
  162|    365|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    365|          num_values, src_buffer, out_values);
  164|    346|    case 15:
  ------------------
  |  Branch (164:5): [True: 346, False: 7.47k]
  ------------------
  165|    346|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    346|          num_values, src_buffer, out_values);
  167|    361|    case 16:
  ------------------
  |  Branch (167:5): [True: 361, False: 7.46k]
  ------------------
  168|    361|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    361|          num_values, src_buffer, out_values);
  170|    375|    case 17:
  ------------------
  |  Branch (170:5): [True: 375, False: 7.44k]
  ------------------
  171|    375|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    375|          num_values, src_buffer, out_values);
  173|    354|    case 18:
  ------------------
  |  Branch (173:5): [True: 354, False: 7.46k]
  ------------------
  174|    354|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    354|          num_values, src_buffer, out_values);
  176|    308|    default:
  ------------------
  |  Branch (176:5): [True: 308, False: 7.51k]
  ------------------
  177|    308|      return false;
  178|  7.82k|  }
  179|  7.82k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    654|                              uint32_t *out_values) {
   93|    654|  SymbolDecoderT decoder;
   94|    654|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 400, False: 254]
  ------------------
   95|    400|    return false;
   96|    400|  }
   97|       |
   98|    254|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 254, False: 0]
  |  Branch (98:25): [True: 19, False: 235]
  ------------------
   99|     19|    return false;  // Wrong number of symbols.
  100|     19|  }
  101|       |
  102|    235|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 78, False: 157]
  ------------------
  103|     78|    return false;
  104|     78|  }
  105|  40.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 40.1M, False: 157]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  40.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  40.1M|    out_values[i] = value;
  109|  40.1M|  }
  110|    157|  decoder.EndDecoding();
  111|    157|  return true;
  112|    235|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    638|                              uint32_t *out_values) {
   93|    638|  SymbolDecoderT decoder;
   94|    638|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 252, False: 386]
  ------------------
   95|    252|    return false;
   96|    252|  }
   97|       |
   98|    386|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 386, False: 0]
  |  Branch (98:25): [True: 13, False: 373]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    373|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 152, False: 221]
  ------------------
  103|    152|    return false;
  104|    152|  }
  105|  4.82M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.82M, False: 221]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.82M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.82M|    out_values[i] = value;
  109|  4.82M|  }
  110|    221|  decoder.EndDecoding();
  111|    221|  return true;
  112|    373|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    454|                              uint32_t *out_values) {
   93|    454|  SymbolDecoderT decoder;
   94|    454|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 192, False: 262]
  ------------------
   95|    192|    return false;
   96|    192|  }
   97|       |
   98|    262|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 262, False: 0]
  |  Branch (98:25): [True: 4, False: 258]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    258|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 137, False: 121]
  ------------------
  103|    137|    return false;
  104|    137|  }
  105|  4.24M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.24M, False: 121]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.24M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.24M|    out_values[i] = value;
  109|  4.24M|  }
  110|    121|  decoder.EndDecoding();
  111|    121|  return true;
  112|    258|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    348|                              uint32_t *out_values) {
   93|    348|  SymbolDecoderT decoder;
   94|    348|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 166, False: 182]
  ------------------
   95|    166|    return false;
   96|    166|  }
   97|       |
   98|    182|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 182, False: 0]
  |  Branch (98:25): [True: 7, False: 175]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    175|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 53, False: 122]
  ------------------
  103|     53|    return false;
  104|     53|  }
  105|  1.68M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.68M, False: 122]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.68M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.68M|    out_values[i] = value;
  109|  1.68M|  }
  110|    122|  decoder.EndDecoding();
  111|    122|  return true;
  112|    175|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    280|                              uint32_t *out_values) {
   93|    280|  SymbolDecoderT decoder;
   94|    280|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 39, False: 241]
  ------------------
   95|     39|    return false;
   96|     39|  }
   97|       |
   98|    241|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 241, False: 0]
  |  Branch (98:25): [True: 148, False: 93]
  ------------------
   99|    148|    return false;  // Wrong number of symbols.
  100|    148|  }
  101|       |
  102|     93|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 19, False: 74]
  ------------------
  103|     19|    return false;
  104|     19|  }
  105|   665k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 665k, False: 74]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   665k|    const uint32_t value = decoder.DecodeSymbol();
  108|   665k|    out_values[i] = value;
  109|   665k|  }
  110|     74|  decoder.EndDecoding();
  111|     74|  return true;
  112|     93|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    479|                              uint32_t *out_values) {
   93|    479|  SymbolDecoderT decoder;
   94|    479|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 171, False: 308]
  ------------------
   95|    171|    return false;
   96|    171|  }
   97|       |
   98|    308|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 308, False: 0]
  |  Branch (98:25): [True: 7, False: 301]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    301|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 136, False: 165]
  ------------------
  103|    136|    return false;
  104|    136|  }
  105|  10.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.6M, False: 165]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.6M|    out_values[i] = value;
  109|  10.6M|  }
  110|    165|  decoder.EndDecoding();
  111|    165|  return true;
  112|    301|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    423|                              uint32_t *out_values) {
   93|    423|  SymbolDecoderT decoder;
   94|    423|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 197, False: 226]
  ------------------
   95|    197|    return false;
   96|    197|  }
   97|       |
   98|    226|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 226, False: 0]
  |  Branch (98:25): [True: 15, False: 211]
  ------------------
   99|     15|    return false;  // Wrong number of symbols.
  100|     15|  }
  101|       |
  102|    211|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 119, False: 92]
  ------------------
  103|    119|    return false;
  104|    119|  }
  105|  6.98M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.98M, False: 92]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.98M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.98M|    out_values[i] = value;
  109|  6.98M|  }
  110|     92|  decoder.EndDecoding();
  111|     92|  return true;
  112|    211|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    481|                              uint32_t *out_values) {
   93|    481|  SymbolDecoderT decoder;
   94|    481|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 227, False: 254]
  ------------------
   95|    227|    return false;
   96|    227|  }
   97|       |
   98|    254|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 254, False: 0]
  |  Branch (98:25): [True: 11, False: 243]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    243|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 145, False: 98]
  ------------------
  103|    145|    return false;
  104|    145|  }
  105|  2.84M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.84M, False: 98]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.84M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.84M|    out_values[i] = value;
  109|  2.84M|  }
  110|     98|  decoder.EndDecoding();
  111|     98|  return true;
  112|    243|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    391|                              uint32_t *out_values) {
   93|    391|  SymbolDecoderT decoder;
   94|    391|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 237, False: 154]
  ------------------
   95|    237|    return false;
   96|    237|  }
   97|       |
   98|    154|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 154, False: 0]
  |  Branch (98:25): [True: 9, False: 145]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    145|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 83, False: 62]
  ------------------
  103|     83|    return false;
  104|     83|  }
  105|   174k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 174k, False: 62]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   174k|    const uint32_t value = decoder.DecodeSymbol();
  108|   174k|    out_values[i] = value;
  109|   174k|  }
  110|     62|  decoder.EndDecoding();
  111|     62|  return true;
  112|    145|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    377|                              uint32_t *out_values) {
   93|    377|  SymbolDecoderT decoder;
   94|    377|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 246, False: 131]
  ------------------
   95|    246|    return false;
   96|    246|  }
   97|       |
   98|    131|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 131, False: 0]
  |  Branch (98:25): [True: 5, False: 126]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    126|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 66, False: 60]
  ------------------
  103|     66|    return false;
  104|     66|  }
  105|   417k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 417k, False: 60]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   417k|    const uint32_t value = decoder.DecodeSymbol();
  108|   417k|    out_values[i] = value;
  109|   417k|  }
  110|     60|  decoder.EndDecoding();
  111|     60|  return true;
  112|    126|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    409|                              uint32_t *out_values) {
   93|    409|  SymbolDecoderT decoder;
   94|    409|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 256, False: 153]
  ------------------
   95|    256|    return false;
   96|    256|  }
   97|       |
   98|    153|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 153, False: 0]
  |  Branch (98:25): [True: 8, False: 145]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    145|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 110, False: 35]
  ------------------
  103|    110|    return false;
  104|    110|  }
  105|  41.9k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 41.9k, False: 35]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  41.9k|    const uint32_t value = decoder.DecodeSymbol();
  108|  41.9k|    out_values[i] = value;
  109|  41.9k|  }
  110|     35|  decoder.EndDecoding();
  111|     35|  return true;
  112|    145|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    410|                              uint32_t *out_values) {
   93|    410|  SymbolDecoderT decoder;
   94|    410|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 257, False: 153]
  ------------------
   95|    257|    return false;
   96|    257|  }
   97|       |
   98|    153|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 153, False: 0]
  |  Branch (98:25): [True: 8, False: 145]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    145|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 104, False: 41]
  ------------------
  103|    104|    return false;
  104|    104|  }
  105|   105k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 105k, False: 41]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   105k|    const uint32_t value = decoder.DecodeSymbol();
  108|   105k|    out_values[i] = value;
  109|   105k|  }
  110|     41|  decoder.EndDecoding();
  111|     41|  return true;
  112|    145|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    368|                              uint32_t *out_values) {
   93|    368|  SymbolDecoderT decoder;
   94|    368|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 232, False: 136]
  ------------------
   95|    232|    return false;
   96|    232|  }
   97|       |
   98|    136|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 136, False: 0]
  |  Branch (98:25): [True: 10, False: 126]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    126|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 78, False: 48]
  ------------------
  103|     78|    return false;
  104|     78|  }
  105|   449k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 449k, False: 48]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   449k|    const uint32_t value = decoder.DecodeSymbol();
  108|   449k|    out_values[i] = value;
  109|   449k|  }
  110|     48|  decoder.EndDecoding();
  111|     48|  return true;
  112|    126|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    365|                              uint32_t *out_values) {
   93|    365|  SymbolDecoderT decoder;
   94|    365|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 221, False: 144]
  ------------------
   95|    221|    return false;
   96|    221|  }
   97|       |
   98|    144|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 144, False: 0]
  |  Branch (98:25): [True: 8, False: 136]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    136|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 102, False: 34]
  ------------------
  103|    102|    return false;
  104|    102|  }
  105|  3.45M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.45M, False: 34]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.45M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.45M|    out_values[i] = value;
  109|  3.45M|  }
  110|     34|  decoder.EndDecoding();
  111|     34|  return true;
  112|    136|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    346|                              uint32_t *out_values) {
   93|    346|  SymbolDecoderT decoder;
   94|    346|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 174, False: 172]
  ------------------
   95|    174|    return false;
   96|    174|  }
   97|       |
   98|    172|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 172, False: 0]
  |  Branch (98:25): [True: 15, False: 157]
  ------------------
   99|     15|    return false;  // Wrong number of symbols.
  100|     15|  }
  101|       |
  102|    157|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 103, False: 54]
  ------------------
  103|    103|    return false;
  104|    103|  }
  105|  6.64M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.64M, False: 54]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.64M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.64M|    out_values[i] = value;
  109|  6.64M|  }
  110|     54|  decoder.EndDecoding();
  111|     54|  return true;
  112|    157|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    361|                              uint32_t *out_values) {
   93|    361|  SymbolDecoderT decoder;
   94|    361|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 182, False: 179]
  ------------------
   95|    182|    return false;
   96|    182|  }
   97|       |
   98|    179|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 179, False: 0]
  |  Branch (98:25): [True: 1, False: 178]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    178|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 111, False: 67]
  ------------------
  103|    111|    return false;
  104|    111|  }
  105|  27.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 27.5M, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  27.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  27.5M|    out_values[i] = value;
  109|  27.5M|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|    178|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    375|                              uint32_t *out_values) {
   93|    375|  SymbolDecoderT decoder;
   94|    375|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 188, False: 187]
  ------------------
   95|    188|    return false;
   96|    188|  }
   97|       |
   98|    187|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 187, False: 0]
  |  Branch (98:25): [True: 14, False: 173]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    173|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 116, False: 57]
  ------------------
  103|    116|    return false;
  104|    116|  }
  105|  28.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 28.4M, False: 57]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  28.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  28.4M|    out_values[i] = value;
  109|  28.4M|  }
  110|     57|  decoder.EndDecoding();
  111|     57|  return true;
  112|    173|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    354|                              uint32_t *out_values) {
   93|    354|  SymbolDecoderT decoder;
   94|    354|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 194, False: 160]
  ------------------
   95|    194|    return false;
   96|    194|  }
   97|       |
   98|    160|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 160, False: 0]
  |  Branch (98:25): [True: 2, False: 158]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    158|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 100, False: 58]
  ------------------
  103|    100|    return false;
  104|    100|  }
  105|  47.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 47.3M, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  47.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  47.3M|    out_values[i] = value;
  109|  47.3M|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    158|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  2.95k|    : decoder_(nullptr),
   49|  2.95k|      last_symbol_id_(-1),
   50|  2.95k|      last_vert_id_(-1),
   51|  2.95k|      last_face_id_(-1),
   52|  2.95k|      num_new_vertices_(0),
   53|  2.95k|      num_encoded_vertices_(0),
   54|  2.95k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.95k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.95k|  decoder_ = decoder;
   60|  2.95k|  return true;
   61|  2.95k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  2.48k|    int att_id) const {
   67|  4.05k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 3.46k, False: 593]
  ------------------
   68|  3.46k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  3.46k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.57k, False: 1.89k]
  |  Branch (69:27): [True: 0, False: 1.89k]
  ------------------
   70|  1.57k|      continue;
   71|  1.57k|    }
   72|  1.89k|    const AttributesDecoderInterface *const dec =
   73|  1.89k|        decoder_->attributes_decoder(decoder_id);
   74|  4.21k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 4.21k, False: 0]
  ------------------
   75|  4.21k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.89k, False: 2.32k]
  ------------------
   76|  1.89k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.26k, False: 625]
  ------------------
   77|  1.26k|          return &attribute_data_[i].connectivity_data;
   78|  1.26k|        }
   79|    625|        return nullptr;
   80|  1.89k|      }
   81|  4.21k|    }
   82|  1.89k|  }
   83|    593|  return nullptr;
   84|  2.48k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  2.48k|    int att_id) const {
   90|  4.05k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 3.46k, False: 593]
  ------------------
   91|  3.46k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  3.46k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.57k, False: 1.89k]
  |  Branch (92:27): [True: 0, False: 1.89k]
  ------------------
   93|  1.57k|      continue;
   94|  1.57k|    }
   95|  1.89k|    const AttributesDecoderInterface *const dec =
   96|  1.89k|        decoder_->attributes_decoder(decoder_id);
   97|  4.21k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 4.21k, False: 0]
  ------------------
   98|  4.21k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.89k, False: 2.32k]
  ------------------
   99|  1.89k|        return &attribute_data_[i].encoding_data;
  100|  1.89k|      }
  101|  4.21k|    }
  102|  1.89k|  }
  103|    593|  return &pos_encoding_data_;
  104|  2.48k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  1.99k|    int32_t att_decoder_id) {
  131|  1.99k|  int8_t att_data_id;
  132|  1.99k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 14, False: 1.98k]
  ------------------
  133|     14|    return false;
  134|     14|  }
  135|  1.98k|  uint8_t decoder_type;
  136|  1.98k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 8, False: 1.97k]
  ------------------
  137|      8|    return false;
  138|      8|  }
  139|       |
  140|  1.97k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.43k, False: 539]
  ------------------
  141|  1.43k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 69, False: 1.36k]
  ------------------
  142|     69|      return false;  // Unexpected attribute data.
  143|     69|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.36k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 9, False: 1.35k]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|       |
  151|  1.35k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.35k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    539|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 538]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    538|    pos_data_decoder_id_ = att_decoder_id;
  158|    538|  }
  159|       |
  160|  1.89k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.89k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.89k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.89k, False: 1]
  ------------------
  162|  1.89k|    uint8_t traversal_method_encoded;
  163|  1.89k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 17, False: 1.87k]
  ------------------
  164|     17|      return false;
  165|     17|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.87k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 56, False: 1.82k]
  ------------------
  168|     56|      return false;
  169|     56|    }
  170|  1.82k|    traversal_method =
  171|  1.82k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.82k|  }
  173|       |
  174|  1.82k|  const Mesh *mesh = decoder_->mesh();
  175|  1.82k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.82k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 895, False: 929]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    895|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    895|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 491, False: 404]
  ------------------
  182|    491|      encoding_data = &pos_encoding_data_;
  183|    491|    } else {
  184|    404|      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|    404|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    404|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    895|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 147, False: 748]
  ------------------
  191|    147|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    147|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    147|          AttTraverser;
  194|    147|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    748|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 748, False: 0]
  ------------------
  196|    748|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    748|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    748|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    748|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    929|  } else {
  203|    929|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 6, False: 923]
  ------------------
  204|      6|      return false;  // Unsupported method.
  205|      6|    }
  206|    923|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 921]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    921|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    921|        AttObserver;
  214|    921|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    921|        AttTraverser;
  216|       |
  217|    921|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    921|        &attribute_data_[att_data_id].encoding_data;
  219|    921|    const MeshAttributeCornerTable *const corner_table =
  220|    921|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    921|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    921|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    921|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    921|                             encoding_data);
  227|       |
  228|    921|    AttTraverser att_traverser;
  229|    921|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    921|    traversal_sequencer->SetTraverser(att_traverser);
  232|    921|    sequencer = std::move(traversal_sequencer);
  233|    921|  }
  234|       |
  235|  1.81k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.81k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.81k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.81k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.81k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.81k|                                        std::move(att_controller));
  244|  1.81k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  2.95k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.95k|  num_new_vertices_ = 0;
  249|  2.95k|  new_to_parent_vertex_map_.clear();
  250|  2.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 627, False: 2.32k]
  ------------------
  252|    627|    uint32_t num_new_verts;
  253|    627|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    627|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 218, False: 409]
  ------------------
  254|    218|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 8, False: 210]
  ------------------
  255|      8|        return false;
  256|      8|      }
  257|    409|    } else {
  258|    409|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 2, False: 407]
  ------------------
  259|      2|        return false;
  260|      2|      }
  261|    409|    }
  262|    617|    num_new_vertices_ = num_new_verts;
  263|    617|  }
  264|  2.94k|#endif
  265|       |
  266|  2.94k|  uint32_t num_encoded_vertices;
  267|  2.94k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.94k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.94k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 210, False: 2.73k]
  ------------------
  269|    210|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 3, False: 207]
  ------------------
  270|      3|      return false;
  271|      3|    }
  272|       |
  273|    210|  } else
  274|  2.73k|#endif
  275|  2.73k|  {
  276|  2.73k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 3, False: 2.73k]
  ------------------
  277|      3|      return false;
  278|      3|    }
  279|  2.73k|  }
  280|  2.93k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.93k|  uint32_t num_faces;
  283|  2.93k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.93k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.93k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 207, False: 2.73k]
  ------------------
  285|    207|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 4, False: 203]
  ------------------
  286|      4|      return false;
  287|      4|    }
  288|       |
  289|    207|  } else
  290|  2.73k|#endif
  291|  2.73k|  {
  292|  2.73k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 4, False: 2.72k]
  ------------------
  293|      4|      return false;
  294|      4|    }
  295|  2.73k|  }
  296|  2.93k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 5, False: 2.92k]
  ------------------
  297|      5|    return false;  // Draco cannot handle this many faces.
  298|      5|  }
  299|       |
  300|  2.92k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 33, False: 2.89k]
  ------------------
  301|     33|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     33|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.89k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  2.89k|  const uint64_t num_encoded_vertices_64 =
  311|  2.89k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.89k|  const uint64_t max_num_vertex_edges =
  313|  2.89k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.89k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 8, False: 2.88k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      8|    return false;
  317|      8|  }
  318|       |
  319|  2.88k|  uint8_t num_attribute_data;
  320|  2.88k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 32, False: 2.85k]
  ------------------
  321|     32|    return false;
  322|     32|  }
  323|       |
  324|  2.85k|  uint32_t num_encoded_symbols;
  325|  2.85k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.85k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.85k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 175, False: 2.67k]
  ------------------
  327|    175|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 13, False: 162]
  ------------------
  328|     13|      return false;
  329|     13|    }
  330|       |
  331|    175|  } else
  332|  2.67k|#endif
  333|  2.67k|  {
  334|  2.67k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 4, False: 2.67k]
  ------------------
  335|      4|      return false;
  336|      4|    }
  337|  2.67k|  }
  338|       |
  339|  2.83k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 22, False: 2.81k]
  ------------------
  340|       |    // Number of faces needs to be the same or greater than the number of
  341|       |    // symbols (it can be greater because the initial face may not be encoded as
  342|       |    // a symbol).
  343|     22|    return false;
  344|     22|  }
  345|  2.81k|  const uint32_t max_encoded_faces =
  346|  2.81k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.81k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 55, False: 2.75k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|     55|    return false;
  352|     55|  }
  353|       |
  354|  2.75k|  uint32_t num_encoded_split_symbols;
  355|  2.75k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.75k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.75k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 123, False: 2.63k]
  ------------------
  357|    123|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 6, False: 117]
  ------------------
  358|      6|      return false;
  359|      6|    }
  360|       |
  361|    123|  } else
  362|  2.63k|#endif
  363|  2.63k|  {
  364|  2.63k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 6, False: 2.62k]
  ------------------
  365|      6|      return false;
  366|      6|    }
  367|  2.63k|  }
  368|       |
  369|  2.74k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 40, False: 2.70k]
  ------------------
  370|     40|    return false;  // Split symbols are a sub-set of all symbols.
  371|     40|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.70k|  vertex_traversal_length_.clear();
  375|  2.70k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.70k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.70k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.70k|  processed_corner_ids_.clear();
  380|  2.70k|  processed_corner_ids_.reserve(num_faces);
  381|  2.70k|  processed_connectivity_corners_.clear();
  382|  2.70k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.70k|  topology_split_data_.clear();
  384|  2.70k|  hole_event_data_.clear();
  385|  2.70k|  init_face_configurations_.clear();
  386|  2.70k|  init_corners_.clear();
  387|       |
  388|  2.70k|  last_symbol_id_ = -1;
  389|  2.70k|  last_face_id_ = -1;
  390|  2.70k|  last_vert_id_ = -1;
  391|       |
  392|  2.70k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.70k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.70k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.70k]
  ------------------
  397|  2.70k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      0|    return false;
  399|      0|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  2.70k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.70k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.70k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.70k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.70k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 504, False: 2.20k]
  ------------------
  411|    504|    uint32_t encoded_connectivity_size;
  412|    504|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    504|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 110, False: 394]
  ------------------
  413|    110|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 7, False: 103]
  ------------------
  414|      7|        return false;
  415|      7|      }
  416|    394|    } else {
  417|    394|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 4, False: 390]
  ------------------
  418|      4|        return false;
  419|      4|      }
  420|    394|    }
  421|    493|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 2, False: 491]
  ------------------
  422|    491|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 30, False: 461]
  ------------------
  423|     32|      return false;
  424|     32|    }
  425|    461|    DecoderBuffer event_buffer;
  426|    461|    event_buffer.Init(
  427|    461|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    461|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    461|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    461|    topology_split_decoded_bytes =
  432|    461|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    461|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 121, False: 340]
  ------------------
  434|    121|      return false;
  435|    121|    }
  436|       |
  437|    461|  } else
  438|  2.20k|#endif
  439|  2.20k|  {
  440|  2.20k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 87, False: 2.11k]
  ------------------
  441|     87|      return false;
  442|     87|    }
  443|  2.20k|  }
  444|       |
  445|  2.45k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.45k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.45k|                                           num_encoded_split_symbols);
  449|  2.45k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.45k|  DecoderBuffer traversal_end_buffer;
  452|  2.45k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 209, False: 2.24k]
  ------------------
  453|    209|    return false;
  454|    209|  }
  455|       |
  456|  2.24k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  2.24k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 247, False: 1.99k]
  ------------------
  458|    247|    return false;
  459|    247|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.99k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.99k|                           traversal_end_buffer.remaining_size(),
  464|  1.99k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.99k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.99k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.99k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 230, False: 1.76k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    230|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    230|  }
  471|  1.99k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.99k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.92k, False: 70]
  ------------------
  475|  1.92k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.92k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.92k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 224, False: 1.70k]
  ------------------
  477|  1.30k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.07k, False: 224]
  ------------------
  478|  1.07k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.07k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.07k|      }
  482|       |
  483|    224|    } else
  484|  1.70k|#endif
  485|  1.70k|    {
  486|   287k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 285k, False: 1.70k]
  ------------------
  487|   285k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 285k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   285k|      }
  491|  1.70k|    }
  492|  1.92k|  }
  493|  1.99k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  6.50k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 4.50k, False: 1.99k]
  ------------------
  498|  4.50k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  2.91M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 2.91M, False: 4.50k]
  ------------------
  501|  2.91M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  2.91M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  4.50k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 4.50k]
  ------------------
  505|  4.50k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  4.50k|  }
  509|       |
  510|  1.99k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  6.50k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 4.50k, False: 1.99k]
  ------------------
  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|  4.50k|    int32_t att_connectivity_verts =
  517|  4.50k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  4.50k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 256, False: 4.25k]
  ------------------
  519|    256|      att_connectivity_verts = corner_table_->num_vertices();
  520|    256|    }
  521|  4.50k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  4.50k|  }
  523|  1.99k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 5, False: 1.99k]
  ------------------
  524|      5|    return false;
  525|      5|  }
  526|  1.99k|  return true;
  527|  1.99k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    442|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    442|  return true;
  532|    442|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  2.24k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  2.24k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  2.24k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  2.24k|  std::vector<VertexIndex> invalid_vertices;
  558|  2.24k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  2.24k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  2.24k|  int num_faces = 0;
  562|  7.40M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 7.40M, False: 2.04k]
  ------------------
  563|  7.40M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  7.40M|    bool check_topology_split = false;
  566|  7.40M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  7.40M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 3.21M, False: 4.18M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  3.21M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 3.21M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  3.21M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  3.21M|      const VertexIndex vertex_x =
  593|  3.21M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  3.21M|      const CornerIndex corner_b =
  595|  3.21M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  3.21M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 145, False: 3.21M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    145|        return -1;
  600|    145|      }
  601|  3.21M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 3.21M]
  |  Branch (601:11): [True: 0, False: 3.21M]
  ------------------
  602|  3.21M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 3.21M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  3.21M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  3.21M|      SetOppositeCorners(corner_a, corner + 1);
  612|  3.21M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  3.21M|      const VertexIndex vert_a_prev =
  616|  3.21M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  3.21M|      const VertexIndex vert_b_next =
  618|  3.21M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  3.21M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 3.21M]
  |  Branch (619:38): [True: 0, False: 3.21M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  3.21M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  3.21M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  3.21M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  3.21M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  3.21M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  3.21M|      active_corner_stack.back() = corner;
  631|  4.18M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 1.26M, False: 2.91M]
  |  Branch (631:40): [True: 483k, False: 2.43M]
  ------------------
  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.74M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 1.74M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  1.74M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  1.74M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 1.74M]
  ------------------
  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.74M|      const CornerIndex corner(3 * face.value());
  658|  1.74M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  1.74M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 1.26M, False: 483k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  1.26M|        opp_corner = corner + 2;
  662|  1.26M|        corner_l = corner + 1;
  663|  1.26M|        corner_r = corner;
  664|  1.26M|      } else {
  665|       |        // "l" is the new first corner.
  666|   483k|        opp_corner = corner + 1;
  667|   483k|        corner_l = corner;
  668|   483k|        corner_r = corner + 2;
  669|   483k|      }
  670|  1.74M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  1.74M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  1.74M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 1, False: 1.74M]
  ------------------
  675|      1|        return -1;  // Unexpected number of decoded vertices.
  676|      1|      }
  677|       |
  678|  1.74M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  1.74M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  1.74M|      const VertexIndex vertex_r =
  682|  1.74M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  1.74M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  1.74M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  1.74M|      corner_table_->MapCornerToVertex(
  688|  1.74M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  1.74M|      active_corner_stack.back() = corner;
  690|  1.74M|      check_topology_split = true;
  691|  2.43M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 856k, False: 1.57M]
  ------------------
  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|   856k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 2, False: 856k]
  ------------------
  703|      2|        return -1;
  704|      2|      }
  705|   856k|      const CornerIndex corner_b = active_corner_stack.back();
  706|   856k|      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|   856k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|   856k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 59, False: 856k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     59|        active_corner_stack.push_back(it->second);
  714|     59|      }
  715|   856k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 15, False: 856k]
  ------------------
  716|     15|        return -1;
  717|     15|      }
  718|   856k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|   856k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 856k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|   856k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 4, False: 856k]
  |  Branch (724:11): [True: 4, False: 856k]
  ------------------
  725|   856k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 856k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      4|        return -1;
  729|      4|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|   856k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|   856k|      SetOppositeCorners(corner_a, corner + 2);
  735|   856k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|   856k|      const VertexIndex vertex_p =
  739|   856k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|   856k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|   856k|      corner_table_->MapCornerToVertex(
  742|   856k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|   856k|      const VertexIndex vert_b_prev =
  744|   856k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|   856k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|   856k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|   856k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|   856k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|   856k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|   856k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|   856k|                                       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|   856k|      const CornerIndex first_corner = corner_n;
  757|  5.58M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 4.72M, False: 856k]
  ------------------
  758|  4.72M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  4.72M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  4.72M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 6, False: 4.72M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      6|          return -1;
  764|      6|        }
  765|  4.72M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|   856k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|   856k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 26.6k, False: 829k]
  ------------------
  770|  26.6k|        invalid_vertices.push_back(vertex_n);
  771|  26.6k|      }
  772|   856k|      active_corner_stack.back() = corner;
  773|  1.57M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 1.57M, False: 0]
  ------------------
  774|  1.57M|      const CornerIndex corner(3 * face.value());
  775|  1.57M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  1.57M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  1.57M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  1.57M|                                       corner_table_->AddNewVertex());
  780|  1.57M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  1.57M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  1.57M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 4, False: 1.57M]
  ------------------
  784|      4|        return -1;  // Unexpected number of decoded vertices.
  785|      4|      }
  786|       |
  787|  1.57M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  1.57M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  1.57M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  1.57M|      active_corner_stack.push_back(corner);
  792|  1.57M|      check_topology_split = true;
  793|  1.57M|    } 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|  7.40M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  7.40M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 3.32M, False: 4.07M]
  ------------------
  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.32M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  3.32M|      EdgeFaceName split_edge;
  812|  3.32M|      int encoder_split_symbol_id;
  813|  3.33M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.62k, False: 3.32M]
  ------------------
  814|  3.33M|                             &encoder_split_symbol_id)) {
  815|  1.62k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 21, False: 1.60k]
  ------------------
  816|     21|          return -1;  // Wrong split symbol id.
  817|     21|        }
  818|       |        // Symbol was part of a topology split. Now we need to determine which
  819|       |        // edge should be added to the active edges stack.
  820|  1.60k|        const CornerIndex act_top_corner = active_corner_stack.back();
  821|       |        // The current symbol has one active edge (stored in act_top_corner) and
  822|       |        // two remaining inactive edges that are attached to it.
  823|       |        //              *
  824|       |        //             / \
  825|       |        //  left_edge /   \ right_edge
  826|       |        //           /     \
  827|       |        //          *.......*
  828|       |        //         active_edge
  829|       |
  830|  1.60k|        CornerIndex new_active_corner;
  831|  1.60k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 649, False: 955]
  ------------------
  832|    649|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    955|        } else {
  834|    955|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    955|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.60k|        const int decoder_split_symbol_id =
  839|  1.60k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.60k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.60k|            new_active_corner;
  842|  1.60k|      }
  843|  3.32M|    }
  844|  7.40M|  }
  845|  2.04k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 2.04k]
  ------------------
  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|  29.6k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 27.6k, False: 2.01k]
  ------------------
  850|  27.6k|    const CornerIndex corner = active_corner_stack.back();
  851|  27.6k|    active_corner_stack.pop_back();
  852|  27.6k|    const bool interior_face =
  853|  27.6k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  27.6k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 18.0k, False: 9.60k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  18.0k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 6, False: 18.0k]
  ------------------
  877|      6|        return -1;  // More faces than expected added to the mesh.
  878|      6|      }
  879|       |
  880|  18.0k|      const CornerIndex corner_a = corner;
  881|  18.0k|      const VertexIndex vert_n =
  882|  18.0k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  18.0k|      const CornerIndex corner_b =
  884|  18.0k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  18.0k|      const VertexIndex vert_x =
  887|  18.0k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  18.0k|      const CornerIndex corner_c =
  889|  18.0k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  18.0k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 9, False: 17.9k]
  |  Branch (891:33): [True: 13, False: 17.9k]
  |  Branch (891:55): [True: 0, False: 17.9k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     22|        return -1;
  894|     22|      }
  895|  17.9k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 17.9k]
  |  Branch (895:11): [True: 1, False: 17.9k]
  ------------------
  896|  17.9k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 17.9k]
  ------------------
  897|  17.9k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 17.9k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      1|        return -1;
  901|      1|      }
  902|       |
  903|  17.9k|      const VertexIndex vert_p =
  904|  17.9k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  17.9k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  17.9k|      const CornerIndex new_corner(3 * face.value());
  909|  17.9k|      SetOppositeCorners(new_corner, corner);
  910|  17.9k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  17.9k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  17.9k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  17.9k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  17.9k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  71.9k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 53.9k, False: 17.9k]
  ------------------
  920|  53.9k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  53.9k|      }
  922|       |
  923|  17.9k|      init_face_configurations_.push_back(true);
  924|  17.9k|      init_corners_.push_back(new_corner);
  925|  17.9k|    } 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|  9.60k|      init_face_configurations_.push_back(false);
  930|  9.60k|      init_corners_.push_back(corner);
  931|  9.60k|    }
  932|  27.6k|  }
  933|  2.01k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 17, False: 2.00k]
  ------------------
  934|     17|    return -1;  // Unexpected number of decoded faces.
  935|     17|  }
  936|       |
  937|  2.00k|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  2.00k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 592, False: 1.99k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    592|    VertexIndex src_vert(num_vertices - 1);
  943|    715|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 123, False: 592]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    123|      src_vert = VertexIndex(--num_vertices - 1);
  946|    123|    }
  947|    592|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 123, False: 469]
  ------------------
  948|    123|      continue;  // No need to swap anything.
  949|    123|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    469|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  2.88k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 2.41k, False: 468]
  ------------------
  954|  2.41k|      const CornerIndex cid = vcit.Corner();
  955|  2.41k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 1, False: 2.41k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      1|        return -1;
  959|      1|      }
  960|  2.41k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  2.41k|    }
  962|    468|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    468|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    468|    corner_table_->MakeVertexIsolated(src_vert);
  967|    468|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    468|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    468|    num_vertices--;
  972|    468|  }
  973|  1.99k|  return num_vertices;
  974|  2.00k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.66k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.66k|  uint32_t num_topology_splits;
  982|  2.66k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.66k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.66k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 90, False: 2.57k]
  ------------------
  984|     90|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 89]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|     90|  } else
  989|  2.57k|#endif
  990|  2.57k|  {
  991|  2.57k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 6, False: 2.56k]
  ------------------
  992|      6|      return -1;
  993|      6|    }
  994|  2.57k|  }
  995|  2.65k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.45k, False: 1.20k]
  ------------------
  996|  1.45k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 43, False: 1.41k]
  ------------------
  997|  1.45k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     43|      return -1;
  999|     43|    }
 1000|  1.41k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.41k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.41k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 44, False: 1.36k]
  ------------------
 1002|  5.14k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 5.12k, False: 20]
  ------------------
 1003|  5.12k|        TopologySplitEventData event_data;
 1004|  5.12k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 16, False: 5.11k]
  ------------------
 1005|     16|          return -1;
 1006|     16|        }
 1007|  5.11k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 7, False: 5.10k]
  ------------------
 1008|      7|          return -1;
 1009|      7|        }
 1010|  5.10k|        uint8_t edge_data;
 1011|  5.10k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 1, False: 5.10k]
  ------------------
 1012|      1|          return -1;
 1013|      1|        }
 1014|  5.10k|        event_data.source_edge = edge_data & 1;
 1015|  5.10k|        topology_split_data_.push_back(event_data);
 1016|  5.10k|      }
 1017|       |
 1018|     44|    } else
 1019|  1.36k|#endif
 1020|  1.36k|    {
 1021|       |      // Decode source and split symbol ids using delta and varint coding. See
 1022|       |      // description in mesh_edgebreaker_encoder_impl.cc for more details.
 1023|  1.36k|      int last_source_symbol_id = 0;
 1024|  6.05k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 4.73k, False: 1.32k]
  ------------------
 1025|  4.73k|        TopologySplitEventData event_data;
 1026|  4.73k|        uint32_t delta;
 1027|  4.73k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 20, False: 4.71k]
  ------------------
 1028|     20|          return -1;
 1029|     20|        }
 1030|  4.71k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  4.71k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 6, False: 4.70k]
  ------------------
 1032|      6|          return -1;
 1033|      6|        }
 1034|  4.70k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 20, False: 4.68k]
  ------------------
 1035|     20|          return -1;
 1036|     20|        }
 1037|  4.68k|        event_data.split_symbol_id =
 1038|  4.68k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.68k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.68k|        topology_split_data_.push_back(event_data);
 1041|  4.68k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.32k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  5.43k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.11k, False: 1.32k]
  ------------------
 1045|  4.11k|        uint32_t edge_data;
 1046|  4.11k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.11k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 433, False: 3.68k]
  ------------------
 1047|    433|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.68k|        } else {
 1049|  3.68k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.68k|        }
 1051|  4.11k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  4.11k|        event_data.source_edge = edge_data & 1;
 1053|  4.11k|      }
 1054|  1.32k|      decoder_buffer->EndBitDecoding();
 1055|  1.32k|    }
 1056|  1.41k|  }
 1057|  2.54k|  uint32_t num_hole_events = 0;
 1058|  2.54k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.54k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.54k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 63, False: 2.48k]
  ------------------
 1060|     63|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 7, False: 56]
  ------------------
 1061|      7|      return -1;
 1062|      7|    }
 1063|  2.48k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 355, False: 2.12k]
  ------------------
 1064|    355|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 10, False: 345]
  ------------------
 1065|     10|      return -1;
 1066|     10|    }
 1067|    355|  }
 1068|  2.52k|#endif
 1069|  2.52k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 83, False: 2.44k]
  ------------------
 1070|     83|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     83|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     83|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 40, False: 43]
  ------------------
 1072|   170k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 170k, False: 1]
  ------------------
 1073|   170k|        HoleEventData event_data;
 1074|   170k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 39, False: 170k]
  ------------------
 1075|     39|          return -1;
 1076|     39|        }
 1077|   170k|        hole_event_data_.push_back(event_data);
 1078|   170k|      }
 1079|       |
 1080|     40|    } else
 1081|     43|#endif
 1082|     43|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     43|      int last_symbol_id = 0;
 1085|  41.0k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 41.0k, False: 11]
  ------------------
 1086|  41.0k|        HoleEventData event_data;
 1087|  41.0k|        uint32_t delta;
 1088|  41.0k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 32, False: 40.9k]
  ------------------
 1089|     32|          return -1;
 1090|     32|        }
 1091|  40.9k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  40.9k|        last_symbol_id = event_data.symbol_id;
 1093|  40.9k|        hole_event_data_.push_back(event_data);
 1094|  40.9k|      }
 1095|     43|    }
 1096|     83|  }
 1097|  2.45k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.52k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.07k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.07k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.07k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  4.31k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 3.23k, False: 1.07k]
  ------------------
 1109|  3.23k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  3.23k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.10k, False: 2.12k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  2.22k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.11k, False: 1.10k]
  ------------------
 1114|  1.11k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.11k|      }
 1116|  1.10k|      continue;
 1117|  1.10k|    }
 1118|       |
 1119|  4.25k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 2.12k, False: 2.12k]
  ------------------
 1120|  2.12k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  2.12k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 1.53k, False: 587]
  ------------------
 1122|  1.53k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  1.53k|      }
 1124|  2.12k|    }
 1125|  2.12k|  }
 1126|  1.07k|  return true;
 1127|  1.07k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   285k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   285k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   285k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   285k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.14M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 857k, False: 285k]
  ------------------
 1139|   857k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   857k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 41.8k, False: 815k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   282k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 240k, False: 41.8k]
  ------------------
 1144|   240k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   240k|      }
 1146|  41.8k|      continue;
 1147|  41.8k|    }
 1148|   815k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   815k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 407k, False: 407k]
  ------------------
 1151|   407k|      continue;
 1152|   407k|    }
 1153|       |
 1154|  3.36M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 2.95M, False: 407k]
  ------------------
 1155|  2.95M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  2.95M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 2.67M, False: 282k]
  ------------------
 1157|  2.67M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  2.67M|      }
 1159|  2.95M|    }
 1160|   407k|  }
 1161|   285k|  return true;
 1162|   285k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  1.99k|    int num_connectivity_verts) {
 1167|       |  // Map between the existing and deduplicated point ids.
 1168|       |  // Note that at this point we have one point id for each corner of the
 1169|       |  // mesh so there is corner_table_->num_corners() point ids.
 1170|  1.99k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.99k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 70, False: 1.92k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  4.67k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 4.60k, False: 70]
  ------------------
 1176|  4.60k|      Mesh::Face face;
 1177|  4.60k|      const CornerIndex start_corner(3 * f.value());
 1178|  18.4k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 13.8k, False: 4.60k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  13.8k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  13.8k|        face[c] = vert_id;
 1182|  13.8k|      }
 1183|  4.60k|      decoder_->mesh()->SetFace(f, face);
 1184|  4.60k|    }
 1185|     70|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     70|    return true;
 1187|     70|  }
 1188|       |  // Else we need to deduplicate multiple attributes.
 1189|       |
 1190|       |  // Map between point id and an associated corner id. Only one corner for
 1191|       |  // each point is stored. The corners are used to sample the attribute values
 1192|       |  // in the last stage of the deduplication.
 1193|  1.92k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.92k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   189k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 187k, False: 1.92k]
  ------------------
 1197|   187k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   187k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 11.3k, False: 176k]
  ------------------
 1199|  11.3k|      continue;  // Isolated vertex.
 1200|  11.3k|    }
 1201|   176k|    CornerIndex deduplication_first_corner = c;
 1202|   176k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 42.9k, False: 133k]
  ------------------
 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|  42.9k|      deduplication_first_corner = c;
 1206|   133k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   145k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 141k, False: 3.91k]
  ------------------
 1210|   141k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 6.05k, False: 135k]
  ------------------
 1211|  6.05k|          continue;  // No seam for this attribute, ignore it.
 1212|  6.05k|        }
 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|   135k|        const VertexIndex vert_id =
 1217|   135k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   135k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   135k|        bool seam_found = false;
 1220|   145k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 139k, False: 5.61k]
  ------------------
 1221|   139k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 5, False: 139k]
  ------------------
 1222|      5|            return false;
 1223|      5|          }
 1224|   139k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 129k, False: 10.2k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   129k|            deduplication_first_corner = act_c;
 1227|   129k|            seam_found = true;
 1228|   129k|            break;
 1229|   129k|          }
 1230|  10.2k|          act_c = corner_table_->SwingRight(act_c);
 1231|  10.2k|        }
 1232|   135k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 129k, False: 5.61k]
  ------------------
 1233|   129k|          break;  // No reason to process other attributes if we found a seam.
 1234|   129k|        }
 1235|   135k|      }
 1236|   133k|    }
 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|   176k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   176k|    corner_to_point_map[c.value()] =
 1246|   176k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   176k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   176k|    CornerIndex prev_c = c;
 1250|   176k|    c = corner_table_->SwingRight(c);
 1251|   917k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 873k, False: 43.1k]
  |  Branch (1251:40): [True: 740k, False: 133k]
  ------------------
 1252|   740k|      bool attribute_seam = false;
 1253|   792k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 772k, False: 19.9k]
  ------------------
 1254|   772k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 720k, False: 51.8k]
  ------------------
 1255|   772k|            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|   720k|          attribute_seam = true;
 1259|   720k|          break;
 1260|   720k|        }
 1261|   772k|      }
 1262|   740k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 720k, False: 19.9k]
  ------------------
 1263|   720k|        corner_to_point_map[c.value()] =
 1264|   720k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   720k|        point_to_corner_map.push_back(c.value());
 1266|   720k|      } else {
 1267|  19.9k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  19.9k|      }
 1269|   740k|      prev_c = c;
 1270|   740k|      c = corner_table_->SwingRight(c);
 1271|   740k|    }
 1272|   176k|  }
 1273|       |  // Add faces.
 1274|   288k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 286k, False: 1.92k]
  ------------------
 1275|   286k|    Mesh::Face face;
 1276|  1.14M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 860k, False: 286k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   860k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   860k|    }
 1280|   286k|    decoder_->mesh()->SetFace(f, face);
 1281|   286k|  }
 1282|  1.92k|  decoder_->point_cloud()->set_num_points(
 1283|  1.92k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.92k|  return true;
 1285|  1.92k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  2.80k|    : decoder_(nullptr),
   49|  2.80k|      last_symbol_id_(-1),
   50|  2.80k|      last_vert_id_(-1),
   51|  2.80k|      last_face_id_(-1),
   52|  2.80k|      num_new_vertices_(0),
   53|  2.80k|      num_encoded_vertices_(0),
   54|  2.80k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.80k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.80k|  decoder_ = decoder;
   60|  2.80k|  return true;
   61|  2.80k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  2.16k|    int att_id) const {
   67|  3.39k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 2.72k, False: 673]
  ------------------
   68|  2.72k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  2.72k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.23k, False: 1.48k]
  |  Branch (69:27): [True: 0, False: 1.48k]
  ------------------
   70|  1.23k|      continue;
   71|  1.23k|    }
   72|  1.48k|    const AttributesDecoderInterface *const dec =
   73|  1.48k|        decoder_->attributes_decoder(decoder_id);
   74|  3.04k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 3.04k, False: 0]
  ------------------
   75|  3.04k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.48k, False: 1.55k]
  ------------------
   76|  1.48k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 956, False: 531]
  ------------------
   77|    956|          return &attribute_data_[i].connectivity_data;
   78|    956|        }
   79|    531|        return nullptr;
   80|  1.48k|      }
   81|  3.04k|    }
   82|  1.48k|  }
   83|    673|  return nullptr;
   84|  2.16k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  2.16k|    int att_id) const {
   90|  3.39k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 2.72k, False: 673]
  ------------------
   91|  2.72k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  2.72k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.23k, False: 1.48k]
  |  Branch (92:27): [True: 0, False: 1.48k]
  ------------------
   93|  1.23k|      continue;
   94|  1.23k|    }
   95|  1.48k|    const AttributesDecoderInterface *const dec =
   96|  1.48k|        decoder_->attributes_decoder(decoder_id);
   97|  3.04k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 3.04k, False: 0]
  ------------------
   98|  3.04k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.48k, False: 1.55k]
  ------------------
   99|  1.48k|        return &attribute_data_[i].encoding_data;
  100|  1.48k|      }
  101|  3.04k|    }
  102|  1.48k|  }
  103|    673|  return &pos_encoding_data_;
  104|  2.16k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  1.87k|    int32_t att_decoder_id) {
  131|  1.87k|  int8_t att_data_id;
  132|  1.87k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 47, False: 1.82k]
  ------------------
  133|     47|    return false;
  134|     47|  }
  135|  1.82k|  uint8_t decoder_type;
  136|  1.82k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 14, False: 1.81k]
  ------------------
  137|     14|    return false;
  138|     14|  }
  139|       |
  140|  1.81k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.30k, False: 504]
  ------------------
  141|  1.30k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 42, False: 1.26k]
  ------------------
  142|     42|      return false;  // Unexpected attribute data.
  143|     42|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.26k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 5, False: 1.26k]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|       |
  151|  1.26k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.26k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    504|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 503]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    503|    pos_data_decoder_id_ = att_decoder_id;
  158|    503|  }
  159|       |
  160|  1.76k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.76k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.76k, False: 0]
  ------------------
  162|  1.76k|    uint8_t traversal_method_encoded;
  163|  1.76k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 10, False: 1.75k]
  ------------------
  164|     10|      return false;
  165|     10|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.75k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 23, False: 1.73k]
  ------------------
  168|     23|      return false;
  169|     23|    }
  170|  1.73k|    traversal_method =
  171|  1.73k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.73k|  }
  173|       |
  174|  1.73k|  const Mesh *mesh = decoder_->mesh();
  175|  1.73k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.73k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 920, False: 810]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    920|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    920|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 479, False: 441]
  ------------------
  182|    479|      encoding_data = &pos_encoding_data_;
  183|    479|    } else {
  184|    441|      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|    441|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    441|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    920|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 233, False: 687]
  ------------------
  191|    233|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    233|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    233|          AttTraverser;
  194|    233|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    687|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 687, False: 0]
  ------------------
  196|    687|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    687|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    687|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    687|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    920|  } else {
  203|    810|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 4, False: 806]
  ------------------
  204|      4|      return false;  // Unsupported method.
  205|      4|    }
  206|    806|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 5, False: 801]
  ------------------
  207|      5|      return false;  // Attribute data must be specified.
  208|      5|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    801|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    801|        AttObserver;
  214|    801|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    801|        AttTraverser;
  216|       |
  217|    801|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    801|        &attribute_data_[att_data_id].encoding_data;
  219|    801|    const MeshAttributeCornerTable *const corner_table =
  220|    801|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    801|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    801|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    801|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    801|                             encoding_data);
  227|       |
  228|    801|    AttTraverser att_traverser;
  229|    801|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    801|    traversal_sequencer->SetTraverser(att_traverser);
  232|    801|    sequencer = std::move(traversal_sequencer);
  233|    801|  }
  234|       |
  235|  1.72k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.72k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.72k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.72k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.72k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.72k|                                        std::move(att_controller));
  244|  1.72k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  2.80k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.80k|  num_new_vertices_ = 0;
  249|  2.80k|  new_to_parent_vertex_map_.clear();
  250|  2.80k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.80k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.80k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 361, False: 2.44k]
  ------------------
  252|    361|    uint32_t num_new_verts;
  253|    361|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    361|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 246, False: 115]
  ------------------
  254|    246|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 9, False: 237]
  ------------------
  255|      9|        return false;
  256|      9|      }
  257|    246|    } else {
  258|    115|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 2, False: 113]
  ------------------
  259|      2|        return false;
  260|      2|      }
  261|    115|    }
  262|    350|    num_new_vertices_ = num_new_verts;
  263|    350|  }
  264|  2.79k|#endif
  265|       |
  266|  2.79k|  uint32_t num_encoded_vertices;
  267|  2.79k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.79k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.79k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 237, False: 2.55k]
  ------------------
  269|    237|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 3, False: 234]
  ------------------
  270|      3|      return false;
  271|      3|    }
  272|       |
  273|    237|  } else
  274|  2.55k|#endif
  275|  2.55k|  {
  276|  2.55k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 1, False: 2.55k]
  ------------------
  277|      1|      return false;
  278|      1|    }
  279|  2.55k|  }
  280|  2.78k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.78k|  uint32_t num_faces;
  283|  2.78k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.78k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.78k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 234, False: 2.55k]
  ------------------
  285|    234|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 3, False: 231]
  ------------------
  286|      3|      return false;
  287|      3|    }
  288|       |
  289|    234|  } else
  290|  2.55k|#endif
  291|  2.55k|  {
  292|  2.55k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 3, False: 2.55k]
  ------------------
  293|      3|      return false;
  294|      3|    }
  295|  2.55k|  }
  296|  2.78k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 6, False: 2.77k]
  ------------------
  297|      6|    return false;  // Draco cannot handle this many faces.
  298|      6|  }
  299|       |
  300|  2.77k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 26, False: 2.75k]
  ------------------
  301|     26|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     26|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.75k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  2.75k|  const uint64_t num_encoded_vertices_64 =
  311|  2.75k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.75k|  const uint64_t max_num_vertex_edges =
  313|  2.75k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.75k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 16, False: 2.73k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     16|    return false;
  317|     16|  }
  318|       |
  319|  2.73k|  uint8_t num_attribute_data;
  320|  2.73k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 31, False: 2.70k]
  ------------------
  321|     31|    return false;
  322|     31|  }
  323|       |
  324|  2.70k|  uint32_t num_encoded_symbols;
  325|  2.70k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.70k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.70k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 202, False: 2.50k]
  ------------------
  327|    202|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 16, False: 186]
  ------------------
  328|     16|      return false;
  329|     16|    }
  330|       |
  331|    202|  } else
  332|  2.50k|#endif
  333|  2.50k|  {
  334|  2.50k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 2, False: 2.49k]
  ------------------
  335|      2|      return false;
  336|      2|    }
  337|  2.50k|  }
  338|       |
  339|  2.68k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 25, False: 2.66k]
  ------------------
  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|     25|    return false;
  344|     25|  }
  345|  2.66k|  const uint32_t max_encoded_faces =
  346|  2.66k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.66k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 51, False: 2.60k]
  ------------------
  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|     51|    return false;
  352|     51|  }
  353|       |
  354|  2.60k|  uint32_t num_encoded_split_symbols;
  355|  2.60k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.60k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.60k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 153, False: 2.45k]
  ------------------
  357|    153|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 3, False: 150]
  ------------------
  358|      3|      return false;
  359|      3|    }
  360|       |
  361|    153|  } else
  362|  2.45k|#endif
  363|  2.45k|  {
  364|  2.45k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 7, False: 2.44k]
  ------------------
  365|      7|      return false;
  366|      7|    }
  367|  2.45k|  }
  368|       |
  369|  2.59k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 35, False: 2.56k]
  ------------------
  370|     35|    return false;  // Split symbols are a sub-set of all symbols.
  371|     35|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.56k|  vertex_traversal_length_.clear();
  375|  2.56k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.56k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.56k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.56k|  processed_corner_ids_.clear();
  380|  2.56k|  processed_corner_ids_.reserve(num_faces);
  381|  2.56k|  processed_connectivity_corners_.clear();
  382|  2.56k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.56k|  topology_split_data_.clear();
  384|  2.56k|  hole_event_data_.clear();
  385|  2.56k|  init_face_configurations_.clear();
  386|  2.56k|  init_corners_.clear();
  387|       |
  388|  2.56k|  last_symbol_id_ = -1;
  389|  2.56k|  last_face_id_ = -1;
  390|  2.56k|  last_vert_id_ = -1;
  391|       |
  392|  2.56k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.56k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.56k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.56k]
  ------------------
  397|  2.56k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      0|    return false;
  399|      0|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  2.56k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.56k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.56k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 247, False: 2.31k]
  ------------------
  411|    247|    uint32_t encoded_connectivity_size;
  412|    247|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    247|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 147, False: 100]
  ------------------
  413|    147|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 3, False: 144]
  ------------------
  414|      3|        return false;
  415|      3|      }
  416|    147|    } else {
  417|    100|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 2, False: 98]
  ------------------
  418|      2|        return false;
  419|      2|      }
  420|    100|    }
  421|    242|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 3, False: 239]
  ------------------
  422|    239|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 21, False: 218]
  ------------------
  423|     24|      return false;
  424|     24|    }
  425|    218|    DecoderBuffer event_buffer;
  426|    218|    event_buffer.Init(
  427|    218|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    218|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    218|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    218|    topology_split_decoded_bytes =
  432|    218|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    218|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 153, False: 65]
  ------------------
  434|    153|      return false;
  435|    153|    }
  436|       |
  437|    218|  } else
  438|  2.31k|#endif
  439|  2.31k|  {
  440|  2.31k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 94, False: 2.22k]
  ------------------
  441|     94|      return false;
  442|     94|    }
  443|  2.31k|  }
  444|       |
  445|  2.28k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.28k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.28k|                                           num_encoded_split_symbols);
  449|  2.28k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.28k|  DecoderBuffer traversal_end_buffer;
  452|  2.28k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 178, False: 2.11k]
  ------------------
  453|    178|    return false;
  454|    178|  }
  455|       |
  456|  2.11k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  2.11k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 163, False: 1.94k]
  ------------------
  458|    163|    return false;
  459|    163|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.94k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.94k|                           traversal_end_buffer.remaining_size(),
  464|  1.94k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.94k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.94k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.94k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 17, False: 1.93k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|     17|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|     17|  }
  471|  1.94k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.94k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.92k, False: 22]
  ------------------
  475|  1.92k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.92k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.92k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 17, False: 1.90k]
  ------------------
  477|  1.83k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.81k, False: 17]
  ------------------
  478|  1.81k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.81k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.81k|      }
  482|       |
  483|     17|    } else
  484|  1.90k|#endif
  485|  1.90k|    {
  486|  12.2M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 12.2M, False: 1.90k]
  ------------------
  487|  12.2M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 12.2M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  12.2M|      }
  491|  1.90k|    }
  492|  1.92k|  }
  493|  1.94k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  4.38k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 2.43k, False: 1.94k]
  ------------------
  498|  2.43k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  17.1M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 17.1M, False: 2.43k]
  ------------------
  501|  17.1M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  17.1M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  2.43k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 2.43k]
  ------------------
  505|  2.43k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  2.43k|  }
  509|       |
  510|  1.94k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  4.38k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 2.43k, False: 1.94k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  2.43k|    int32_t att_connectivity_verts =
  517|  2.43k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  2.43k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 184, False: 2.25k]
  ------------------
  519|    184|      att_connectivity_verts = corner_table_->num_vertices();
  520|    184|    }
  521|  2.43k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  2.43k|  }
  523|  1.94k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 14, False: 1.93k]
  ------------------
  524|     14|    return false;
  525|     14|  }
  526|  1.93k|  return true;
  527|  1.94k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    690|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    690|  return true;
  532|    690|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  2.11k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  2.11k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  2.11k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  2.11k|  std::vector<VertexIndex> invalid_vertices;
  558|  2.11k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  2.11k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  2.11k|  int num_faces = 0;
  562|  51.2M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 51.2M, False: 2.01k]
  ------------------
  563|  51.2M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  51.2M|    bool check_topology_split = false;
  566|  51.2M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  51.2M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 25.4M, False: 25.7M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  25.4M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 25.4M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  25.4M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  25.4M|      const VertexIndex vertex_x =
  593|  25.4M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  25.4M|      const CornerIndex corner_b =
  595|  25.4M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  25.4M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 34, False: 25.4M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     34|        return -1;
  600|     34|      }
  601|  25.4M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 25.4M]
  |  Branch (601:11): [True: 0, False: 25.4M]
  ------------------
  602|  25.4M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 25.4M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  25.4M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  25.4M|      SetOppositeCorners(corner_a, corner + 1);
  612|  25.4M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  25.4M|      const VertexIndex vert_a_prev =
  616|  25.4M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  25.4M|      const VertexIndex vert_b_next =
  618|  25.4M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  25.4M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 25.4M]
  |  Branch (619:38): [True: 0, False: 25.4M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  25.4M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  25.4M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  25.4M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  25.4M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  25.4M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  25.4M|      active_corner_stack.back() = corner;
  631|  25.7M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 25.7M, False: 32.0k]
  |  Branch (631:40): [True: 6.43k, False: 25.5k]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  25.7M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 25.7M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  25.7M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  25.7M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 25.7M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  25.7M|      const CornerIndex corner(3 * face.value());
  658|  25.7M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  25.7M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 25.7M, False: 6.43k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  25.7M|        opp_corner = corner + 2;
  662|  25.7M|        corner_l = corner + 1;
  663|  25.7M|        corner_r = corner;
  664|  25.7M|      } else {
  665|       |        // "l" is the new first corner.
  666|  6.43k|        opp_corner = corner + 1;
  667|  6.43k|        corner_l = corner;
  668|  6.43k|        corner_r = corner + 2;
  669|  6.43k|      }
  670|  25.7M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  25.7M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  25.7M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 12, False: 25.7M]
  ------------------
  675|     12|        return -1;  // Unexpected number of decoded vertices.
  676|     12|      }
  677|       |
  678|  25.7M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  25.7M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  25.7M|      const VertexIndex vertex_r =
  682|  25.7M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  25.7M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  25.7M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  25.7M|      corner_table_->MapCornerToVertex(
  688|  25.7M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  25.7M|      active_corner_stack.back() = corner;
  690|  25.7M|      check_topology_split = true;
  691|  25.7M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 8.10k, False: 17.4k]
  ------------------
  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|  8.10k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 8.10k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  8.10k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  8.10k|      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|  8.10k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  8.10k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 23, False: 8.08k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     23|        active_corner_stack.push_back(it->second);
  714|     23|      }
  715|  8.10k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 10, False: 8.09k]
  ------------------
  716|     10|        return -1;
  717|     10|      }
  718|  8.09k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  8.09k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 8.09k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  8.09k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 7, False: 8.08k]
  |  Branch (724:11): [True: 7, False: 8.08k]
  ------------------
  725|  8.08k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 8.08k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      7|        return -1;
  729|      7|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  8.08k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  8.08k|      SetOppositeCorners(corner_a, corner + 2);
  735|  8.08k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  8.08k|      const VertexIndex vertex_p =
  739|  8.08k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  8.08k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  8.08k|      corner_table_->MapCornerToVertex(
  742|  8.08k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  8.08k|      const VertexIndex vert_b_prev =
  744|  8.08k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  8.08k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  8.08k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  8.08k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  8.08k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  8.08k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  8.08k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  8.08k|                                       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|  8.08k|      const CornerIndex first_corner = corner_n;
  757|  31.1k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 23.0k, False: 8.08k]
  ------------------
  758|  23.0k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  23.0k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  23.0k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 23.0k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  23.0k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  8.08k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  8.08k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 3.54k, False: 4.53k]
  ------------------
  770|  3.54k|        invalid_vertices.push_back(vertex_n);
  771|  3.54k|      }
  772|  8.08k|      active_corner_stack.back() = corner;
  773|  17.4k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 17.4k, False: 0]
  ------------------
  774|  17.4k|      const CornerIndex corner(3 * face.value());
  775|  17.4k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  17.4k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  17.4k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  17.4k|                                       corner_table_->AddNewVertex());
  780|  17.4k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  17.4k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  17.4k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 4, False: 17.4k]
  ------------------
  784|      4|        return -1;  // Unexpected number of decoded vertices.
  785|      4|      }
  786|       |
  787|  17.4k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  17.4k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  17.4k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  17.4k|      active_corner_stack.push_back(corner);
  792|  17.4k|      check_topology_split = true;
  793|  17.4k|    } 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|  51.2M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  51.2M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 25.7M, False: 25.4M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  25.7M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  25.7M|      EdgeFaceName split_edge;
  812|  25.7M|      int encoder_split_symbol_id;
  813|  25.7M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.47k, False: 25.7M]
  ------------------
  814|  25.7M|                             &encoder_split_symbol_id)) {
  815|  1.47k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 27, False: 1.44k]
  ------------------
  816|     27|          return -1;  // Wrong split symbol id.
  817|     27|        }
  818|       |        // Symbol was part of a topology split. Now we need to determine which
  819|       |        // edge should be added to the active edges stack.
  820|  1.44k|        const CornerIndex act_top_corner = active_corner_stack.back();
  821|       |        // The current symbol has one active edge (stored in act_top_corner) and
  822|       |        // two remaining inactive edges that are attached to it.
  823|       |        //              *
  824|       |        //             / \
  825|       |        //  left_edge /   \ right_edge
  826|       |        //           /     \
  827|       |        //          *.......*
  828|       |        //         active_edge
  829|       |
  830|  1.44k|        CornerIndex new_active_corner;
  831|  1.44k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 560, False: 886]
  ------------------
  832|    560|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    886|        } else {
  834|    886|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    886|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.44k|        const int decoder_split_symbol_id =
  839|  1.44k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.44k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.44k|            new_active_corner;
  842|  1.44k|      }
  843|  25.7M|    }
  844|  51.2M|  }
  845|  2.01k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 2.01k]
  ------------------
  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|  9.57k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 7.58k, False: 1.98k]
  ------------------
  850|  7.58k|    const CornerIndex corner = active_corner_stack.back();
  851|  7.58k|    active_corner_stack.pop_back();
  852|  7.58k|    const bool interior_face =
  853|  7.58k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  7.58k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 3.48k, False: 4.09k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  3.48k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 7, False: 3.48k]
  ------------------
  877|      7|        return -1;  // More faces than expected added to the mesh.
  878|      7|      }
  879|       |
  880|  3.48k|      const CornerIndex corner_a = corner;
  881|  3.48k|      const VertexIndex vert_n =
  882|  3.48k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  3.48k|      const CornerIndex corner_b =
  884|  3.48k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  3.48k|      const VertexIndex vert_x =
  887|  3.48k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  3.48k|      const CornerIndex corner_c =
  889|  3.48k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  3.48k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 4, False: 3.47k]
  |  Branch (891:33): [True: 11, False: 3.46k]
  |  Branch (891:55): [True: 0, False: 3.46k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     15|        return -1;
  894|     15|      }
  895|  3.46k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 2, False: 3.46k]
  |  Branch (895:11): [True: 2, False: 3.46k]
  ------------------
  896|  3.46k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 3.46k]
  ------------------
  897|  3.46k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 3.46k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      2|        return -1;
  901|      2|      }
  902|       |
  903|  3.46k|      const VertexIndex vert_p =
  904|  3.46k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  3.46k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  3.46k|      const CornerIndex new_corner(3 * face.value());
  909|  3.46k|      SetOppositeCorners(new_corner, corner);
  910|  3.46k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  3.46k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  3.46k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  3.46k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  3.46k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  13.8k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 10.3k, False: 3.46k]
  ------------------
  920|  10.3k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  10.3k|      }
  922|       |
  923|  3.46k|      init_face_configurations_.push_back(true);
  924|  3.46k|      init_corners_.push_back(new_corner);
  925|  4.09k|    } 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|  4.09k|      init_face_configurations_.push_back(false);
  930|  4.09k|      init_corners_.push_back(corner);
  931|  4.09k|    }
  932|  7.58k|  }
  933|  1.98k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 36, False: 1.95k]
  ------------------
  934|     36|    return -1;  // Unexpected number of decoded faces.
  935|     36|  }
  936|       |
  937|  1.95k|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  1.95k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 182, False: 1.94k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    182|    VertexIndex src_vert(num_vertices - 1);
  943|    214|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 32, False: 182]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     32|      src_vert = VertexIndex(--num_vertices - 1);
  946|     32|    }
  947|    182|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 32, False: 150]
  ------------------
  948|     32|      continue;  // No need to swap anything.
  949|     32|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    150|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|    844|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 699, False: 145]
  ------------------
  954|    699|      const CornerIndex cid = vcit.Corner();
  955|    699|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 5, False: 694]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      5|        return -1;
  959|      5|      }
  960|    694|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|    694|    }
  962|    145|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    145|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    145|    corner_table_->MakeVertexIsolated(src_vert);
  967|    145|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    145|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    145|    num_vertices--;
  972|    145|  }
  973|  1.94k|  return num_vertices;
  974|  1.95k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.53k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.53k|  uint32_t num_topology_splits;
  982|  2.53k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.53k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.53k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 127, False: 2.40k]
  ------------------
  984|    127|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 3, False: 124]
  ------------------
  985|      3|      return -1;
  986|      3|    }
  987|       |
  988|    127|  } else
  989|  2.40k|#endif
  990|  2.40k|  {
  991|  2.40k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 15, False: 2.39k]
  ------------------
  992|     15|      return -1;
  993|     15|    }
  994|  2.40k|  }
  995|  2.51k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 808, False: 1.70k]
  ------------------
  996|    808|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 61, False: 747]
  ------------------
  997|    808|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     61|      return -1;
  999|     61|    }
 1000|    747|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    747|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    747|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 63, False: 684]
  ------------------
 1002|  28.3k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 28.3k, False: 30]
  ------------------
 1003|  28.3k|        TopologySplitEventData event_data;
 1004|  28.3k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 19, False: 28.3k]
  ------------------
 1005|     19|          return -1;
 1006|     19|        }
 1007|  28.3k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 11, False: 28.2k]
  ------------------
 1008|     11|          return -1;
 1009|     11|        }
 1010|  28.2k|        uint8_t edge_data;
 1011|  28.2k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 28.2k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|  28.2k|        event_data.source_edge = edge_data & 1;
 1015|  28.2k|        topology_split_data_.push_back(event_data);
 1016|  28.2k|      }
 1017|       |
 1018|     63|    } else
 1019|    684|#endif
 1020|    684|    {
 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|    684|      int last_source_symbol_id = 0;
 1024|  3.93k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.29k, False: 637]
  ------------------
 1025|  3.29k|        TopologySplitEventData event_data;
 1026|  3.29k|        uint32_t delta;
 1027|  3.29k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 20, False: 3.27k]
  ------------------
 1028|     20|          return -1;
 1029|     20|        }
 1030|  3.27k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.27k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 5, False: 3.27k]
  ------------------
 1032|      5|          return -1;
 1033|      5|        }
 1034|  3.27k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 22, False: 3.24k]
  ------------------
 1035|     22|          return -1;
 1036|     22|        }
 1037|  3.24k|        event_data.split_symbol_id =
 1038|  3.24k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.24k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.24k|        topology_split_data_.push_back(event_data);
 1041|  3.24k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    637|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.47k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.83k, False: 637]
  ------------------
 1045|  2.83k|        uint32_t edge_data;
 1046|  2.83k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.83k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 435, False: 2.39k]
  ------------------
 1047|    435|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.39k|        } else {
 1049|  2.39k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.39k|        }
 1051|  2.83k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  2.83k|        event_data.source_edge = edge_data & 1;
 1053|  2.83k|      }
 1054|    637|      decoder_buffer->EndBitDecoding();
 1055|    637|    }
 1056|    747|  }
 1057|  2.37k|  uint32_t num_hole_events = 0;
 1058|  2.37k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.37k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.37k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 72, False: 2.30k]
  ------------------
 1060|     72|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 69]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  2.30k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.30k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 74, False: 2.23k]
  ------------------
 1064|     74|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 6, False: 68]
  ------------------
 1065|      6|      return -1;
 1066|      6|    }
 1067|     74|  }
 1068|  2.36k|#endif
 1069|  2.36k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 87, False: 2.28k]
  ------------------
 1070|     87|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     87|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     87|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 59, False: 28]
  ------------------
 1072|  65.9k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 65.9k, False: 2]
  ------------------
 1073|  65.9k|        HoleEventData event_data;
 1074|  65.9k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 57, False: 65.8k]
  ------------------
 1075|     57|          return -1;
 1076|     57|        }
 1077|  65.8k|        hole_event_data_.push_back(event_data);
 1078|  65.8k|      }
 1079|       |
 1080|     59|    } else
 1081|     28|#endif
 1082|     28|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     28|      int last_symbol_id = 0;
 1085|  5.06k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 5.06k, False: 6]
  ------------------
 1086|  5.06k|        HoleEventData event_data;
 1087|  5.06k|        uint32_t delta;
 1088|  5.06k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 22, False: 5.03k]
  ------------------
 1089|     22|          return -1;
 1090|     22|        }
 1091|  5.03k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  5.03k|        last_symbol_id = event_data.symbol_id;
 1093|  5.03k|        hole_event_data_.push_back(event_data);
 1094|  5.03k|      }
 1095|     28|    }
 1096|     87|  }
 1097|  2.28k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.36k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.81k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.81k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.81k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  7.27k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 5.45k, False: 1.81k]
  ------------------
 1109|  5.45k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  5.45k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 755, False: 4.70k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  1.51k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 755, False: 755]
  ------------------
 1114|    755|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|    755|      }
 1116|    755|      continue;
 1117|    755|    }
 1118|       |
 1119|  9.40k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 4.70k, False: 4.70k]
  ------------------
 1120|  4.70k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  4.70k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 4.61k, False: 86]
  ------------------
 1122|  4.61k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  4.61k|      }
 1124|  4.70k|    }
 1125|  4.70k|  }
 1126|  1.81k|  return true;
 1127|  1.81k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  12.2M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  12.2M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  12.2M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  12.2M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  49.1M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 36.8M, False: 12.2M]
  ------------------
 1139|  36.8M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  36.8M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 159k, False: 36.7M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   327k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 168k, False: 159k]
  ------------------
 1144|   168k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   168k|      }
 1146|   159k|      continue;
 1147|   159k|    }
 1148|  36.7M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  36.7M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 18.3M, False: 18.3M]
  ------------------
 1151|  18.3M|      continue;
 1152|  18.3M|    }
 1153|       |
 1154|  37.5M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 19.1M, False: 18.3M]
  ------------------
 1155|  19.1M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  19.1M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 17.0M, False: 2.17M]
  ------------------
 1157|  17.0M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  17.0M|      }
 1159|  19.1M|    }
 1160|  18.3M|  }
 1161|  12.2M|  return true;
 1162|  12.2M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  1.94k|    int num_connectivity_verts) {
 1167|       |  // Map between the existing and deduplicated point ids.
 1168|       |  // Note that at this point we have one point id for each corner of the
 1169|       |  // mesh so there is corner_table_->num_corners() point ids.
 1170|  1.94k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.94k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 22, False: 1.92k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  15.7k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 15.6k, False: 22]
  ------------------
 1176|  15.6k|      Mesh::Face face;
 1177|  15.6k|      const CornerIndex start_corner(3 * f.value());
 1178|  62.7k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 47.0k, False: 15.6k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  47.0k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  47.0k|        face[c] = vert_id;
 1182|  47.0k|      }
 1183|  15.6k|      decoder_->mesh()->SetFace(f, face);
 1184|  15.6k|    }
 1185|     22|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     22|    return true;
 1187|     22|  }
 1188|       |  // Else we need to deduplicate multiple attributes.
 1189|       |
 1190|       |  // Map between point id and an associated corner id. Only one corner for
 1191|       |  // each point is stored. The corners are used to sample the attribute values
 1192|       |  // in the last stage of the deduplication.
 1193|  1.92k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.92k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  6.19M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 6.19M, False: 1.91k]
  ------------------
 1197|  6.19M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  6.19M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 3.10k, False: 6.18M]
  ------------------
 1199|  3.10k|      continue;  // Isolated vertex.
 1200|  3.10k|    }
 1201|  6.18M|    CornerIndex deduplication_first_corner = c;
 1202|  6.18M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 158k, False: 6.02M]
  ------------------
 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|   158k|      deduplication_first_corner = c;
 1206|  6.02M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  6.63M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 6.03M, False: 599k]
  ------------------
 1210|  6.03M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 585k, False: 5.44M]
  ------------------
 1211|   585k|          continue;  // No seam for this attribute, ignore it.
 1212|   585k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|  5.44M|        const VertexIndex vert_id =
 1217|  5.44M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  5.44M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  5.44M|        bool seam_found = false;
 1220|  5.62M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 5.60M, False: 17.2k]
  ------------------
 1221|  5.60M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 14, False: 5.60M]
  ------------------
 1222|     14|            return false;
 1223|     14|          }
 1224|  5.60M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 5.43M, False: 172k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  5.43M|            deduplication_first_corner = act_c;
 1227|  5.43M|            seam_found = true;
 1228|  5.43M|            break;
 1229|  5.43M|          }
 1230|   172k|          act_c = corner_table_->SwingRight(act_c);
 1231|   172k|        }
 1232|  5.44M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 5.43M, False: 17.2k]
  ------------------
 1233|  5.43M|          break;  // No reason to process other attributes if we found a seam.
 1234|  5.43M|        }
 1235|  5.44M|      }
 1236|  6.02M|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|  6.18M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  6.18M|    corner_to_point_map[c.value()] =
 1246|  6.18M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  6.18M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  6.18M|    CornerIndex prev_c = c;
 1250|  6.18M|    c = corner_table_->SwingRight(c);
 1251|  36.6M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 36.4M, False: 160k]
  |  Branch (1251:40): [True: 30.4M, False: 6.02M]
  ------------------
 1252|  30.4M|      bool attribute_seam = false;
 1253|  33.5M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 30.4M, False: 3.13M]
  ------------------
 1254|  30.4M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 27.2M, False: 3.15M]
  ------------------
 1255|  30.4M|            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|  27.2M|          attribute_seam = true;
 1259|  27.2M|          break;
 1260|  27.2M|        }
 1261|  30.4M|      }
 1262|  30.4M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 27.2M, False: 3.13M]
  ------------------
 1263|  27.2M|        corner_to_point_map[c.value()] =
 1264|  27.2M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  27.2M|        point_to_corner_map.push_back(c.value());
 1266|  27.2M|      } else {
 1267|  3.13M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  3.13M|      }
 1269|  30.4M|      prev_c = c;
 1270|  30.4M|      c = corner_table_->SwingRight(c);
 1271|  30.4M|    }
 1272|  6.18M|  }
 1273|       |  // Add faces.
 1274|  12.1M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 12.1M, False: 1.91k]
  ------------------
 1275|  12.1M|    Mesh::Face face;
 1276|  48.6M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 36.4M, False: 12.1M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  36.4M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  36.4M|    }
 1280|  12.1M|    decoder_->mesh()->SetFace(f, face);
 1281|  12.1M|  }
 1282|  1.91k|  decoder_->point_cloud()->set_num_points(
 1283|  1.91k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.91k|  return true;
 1285|  1.92k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  2.66k|    : decoder_(nullptr),
   49|  2.66k|      last_symbol_id_(-1),
   50|  2.66k|      last_vert_id_(-1),
   51|  2.66k|      last_face_id_(-1),
   52|  2.66k|      num_new_vertices_(0),
   53|  2.66k|      num_encoded_vertices_(0),
   54|  2.66k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.66k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.66k|  decoder_ = decoder;
   60|  2.66k|  return true;
   61|  2.66k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    143|    int att_id) const {
   67|    214|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 169, False: 45]
  ------------------
   68|    169|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    169|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 71, False: 98]
  |  Branch (69:27): [True: 0, False: 98]
  ------------------
   70|     71|      continue;
   71|     71|    }
   72|     98|    const AttributesDecoderInterface *const dec =
   73|     98|        decoder_->attributes_decoder(decoder_id);
   74|  1.04k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 1.04k, False: 0]
  ------------------
   75|  1.04k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 98, False: 943]
  ------------------
   76|     98|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 67, False: 31]
  ------------------
   77|     67|          return &attribute_data_[i].connectivity_data;
   78|     67|        }
   79|     31|        return nullptr;
   80|     98|      }
   81|  1.04k|    }
   82|     98|  }
   83|     45|  return nullptr;
   84|    143|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    143|    int att_id) const {
   90|    214|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 169, False: 45]
  ------------------
   91|    169|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    169|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 71, False: 98]
  |  Branch (92:27): [True: 0, False: 98]
  ------------------
   93|     71|      continue;
   94|     71|    }
   95|     98|    const AttributesDecoderInterface *const dec =
   96|     98|        decoder_->attributes_decoder(decoder_id);
   97|  1.04k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 1.04k, False: 0]
  ------------------
   98|  1.04k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 98, False: 943]
  ------------------
   99|     98|        return &attribute_data_[i].encoding_data;
  100|     98|      }
  101|  1.04k|    }
  102|     98|  }
  103|     45|  return &pos_encoding_data_;
  104|    143|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    163|    int32_t att_decoder_id) {
  131|    163|  int8_t att_data_id;
  132|    163|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 7, False: 156]
  ------------------
  133|      7|    return false;
  134|      7|  }
  135|    156|  uint8_t decoder_type;
  136|    156|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 8, False: 148]
  ------------------
  137|      8|    return false;
  138|      8|  }
  139|       |
  140|    148|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 90, False: 58]
  ------------------
  141|     90|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 22, False: 68]
  ------------------
  142|     22|      return false;  // Unexpected attribute data.
  143|     22|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|     68|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 4, False: 64]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|       |
  151|     64|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|     64|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|     58|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 3, False: 55]
  ------------------
  155|      3|      return false;  // Some other decoder is already using the data. Error.
  156|      3|    }
  157|     55|    pos_data_decoder_id_ = att_decoder_id;
  158|     55|  }
  159|       |
  160|    119|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    119|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    119|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 119, False: 0]
  ------------------
  162|    119|    uint8_t traversal_method_encoded;
  163|    119|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 3, False: 116]
  ------------------
  164|      3|      return false;
  165|      3|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    116|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 15, False: 101]
  ------------------
  168|     15|      return false;
  169|     15|    }
  170|    101|    traversal_method =
  171|    101|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    101|  }
  173|       |
  174|    101|  const Mesh *mesh = decoder_->mesh();
  175|    101|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    101|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 56, False: 45]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|     56|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|     56|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 38, False: 18]
  ------------------
  182|     38|      encoding_data = &pos_encoding_data_;
  183|     38|    } else {
  184|     18|      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|     18|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     18|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|     56|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 24, False: 32]
  ------------------
  191|     24|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     24|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     24|          AttTraverser;
  194|     24|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|     32|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 32, False: 0]
  ------------------
  196|     32|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|     32|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|     32|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|     32|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|     56|  } else {
  203|     45|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 2, False: 43]
  ------------------
  204|      2|      return false;  // Unsupported method.
  205|      2|    }
  206|     43|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 41]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     41|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     41|        AttObserver;
  214|     41|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     41|        AttTraverser;
  216|       |
  217|     41|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     41|        &attribute_data_[att_data_id].encoding_data;
  219|     41|    const MeshAttributeCornerTable *const corner_table =
  220|     41|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     41|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     41|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     41|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     41|                             encoding_data);
  227|       |
  228|     41|    AttTraverser att_traverser;
  229|     41|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     41|    traversal_sequencer->SetTraverser(att_traverser);
  232|     41|    sequencer = std::move(traversal_sequencer);
  233|     41|  }
  234|       |
  235|     97|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 97]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|     97|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|     97|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|     97|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|     97|                                        std::move(att_controller));
  244|     97|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  2.66k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.66k|  num_new_vertices_ = 0;
  249|  2.66k|  new_to_parent_vertex_map_.clear();
  250|  2.66k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.66k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.66k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 448, False: 2.21k]
  ------------------
  252|    448|    uint32_t num_new_verts;
  253|    448|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    448|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 227, False: 221]
  ------------------
  254|    227|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 7, False: 220]
  ------------------
  255|      7|        return false;
  256|      7|      }
  257|    227|    } else {
  258|    221|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 2, False: 219]
  ------------------
  259|      2|        return false;
  260|      2|      }
  261|    221|    }
  262|    439|    num_new_vertices_ = num_new_verts;
  263|    439|  }
  264|  2.65k|#endif
  265|       |
  266|  2.65k|  uint32_t num_encoded_vertices;
  267|  2.65k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.65k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.65k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 220, False: 2.43k]
  ------------------
  269|    220|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 4, False: 216]
  ------------------
  270|      4|      return false;
  271|      4|    }
  272|       |
  273|    220|  } else
  274|  2.43k|#endif
  275|  2.43k|  {
  276|  2.43k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 7, False: 2.42k]
  ------------------
  277|      7|      return false;
  278|      7|    }
  279|  2.43k|  }
  280|  2.64k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.64k|  uint32_t num_faces;
  283|  2.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.64k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 216, False: 2.42k]
  ------------------
  285|    216|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 4, False: 212]
  ------------------
  286|      4|      return false;
  287|      4|    }
  288|       |
  289|    216|  } else
  290|  2.42k|#endif
  291|  2.42k|  {
  292|  2.42k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 3, False: 2.42k]
  ------------------
  293|      3|      return false;
  294|      3|    }
  295|  2.42k|  }
  296|  2.63k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 3, False: 2.63k]
  ------------------
  297|      3|    return false;  // Draco cannot handle this many faces.
  298|      3|  }
  299|       |
  300|  2.63k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 24, False: 2.60k]
  ------------------
  301|     24|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     24|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.60k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  2.60k|  const uint64_t num_encoded_vertices_64 =
  311|  2.60k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.60k|  const uint64_t max_num_vertex_edges =
  313|  2.60k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.60k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 16, False: 2.59k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     16|    return false;
  317|     16|  }
  318|       |
  319|  2.59k|  uint8_t num_attribute_data;
  320|  2.59k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 35, False: 2.55k]
  ------------------
  321|     35|    return false;
  322|     35|  }
  323|       |
  324|  2.55k|  uint32_t num_encoded_symbols;
  325|  2.55k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.55k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.55k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 195, False: 2.36k]
  ------------------
  327|    195|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 12, False: 183]
  ------------------
  328|     12|      return false;
  329|     12|    }
  330|       |
  331|    195|  } else
  332|  2.36k|#endif
  333|  2.36k|  {
  334|  2.36k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 7, False: 2.35k]
  ------------------
  335|      7|      return false;
  336|      7|    }
  337|  2.36k|  }
  338|       |
  339|  2.53k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 21, False: 2.51k]
  ------------------
  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|     21|    return false;
  344|     21|  }
  345|  2.51k|  const uint32_t max_encoded_faces =
  346|  2.51k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.51k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 44, False: 2.47k]
  ------------------
  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|     44|    return false;
  352|     44|  }
  353|       |
  354|  2.47k|  uint32_t num_encoded_split_symbols;
  355|  2.47k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.47k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.47k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 164, False: 2.30k]
  ------------------
  357|    164|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 5, False: 159]
  ------------------
  358|      5|      return false;
  359|      5|    }
  360|       |
  361|    164|  } else
  362|  2.30k|#endif
  363|  2.30k|  {
  364|  2.30k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 4, False: 2.30k]
  ------------------
  365|      4|      return false;
  366|      4|    }
  367|  2.30k|  }
  368|       |
  369|  2.46k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 27, False: 2.43k]
  ------------------
  370|     27|    return false;  // Split symbols are a sub-set of all symbols.
  371|     27|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.43k|  vertex_traversal_length_.clear();
  375|  2.43k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.43k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.43k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.43k|  processed_corner_ids_.clear();
  380|  2.43k|  processed_corner_ids_.reserve(num_faces);
  381|  2.43k|  processed_connectivity_corners_.clear();
  382|  2.43k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.43k|  topology_split_data_.clear();
  384|  2.43k|  hole_event_data_.clear();
  385|  2.43k|  init_face_configurations_.clear();
  386|  2.43k|  init_corners_.clear();
  387|       |
  388|  2.43k|  last_symbol_id_ = -1;
  389|  2.43k|  last_face_id_ = -1;
  390|  2.43k|  last_vert_id_ = -1;
  391|       |
  392|  2.43k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.43k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.43k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.43k]
  ------------------
  397|  2.43k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      0|    return false;
  399|      0|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  2.43k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.43k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.43k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.43k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.43k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 359, False: 2.07k]
  ------------------
  411|    359|    uint32_t encoded_connectivity_size;
  412|    359|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    359|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 157, False: 202]
  ------------------
  413|    157|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 4, False: 153]
  ------------------
  414|      4|        return false;
  415|      4|      }
  416|    202|    } else {
  417|    202|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 2, False: 200]
  ------------------
  418|      2|        return false;
  419|      2|      }
  420|    202|    }
  421|    353|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 352]
  ------------------
  422|    352|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 21, False: 331]
  ------------------
  423|     22|      return false;
  424|     22|    }
  425|    331|    DecoderBuffer event_buffer;
  426|    331|    event_buffer.Init(
  427|    331|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    331|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    331|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    331|    topology_split_decoded_bytes =
  432|    331|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    331|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 95, False: 236]
  ------------------
  434|     95|      return false;
  435|     95|    }
  436|       |
  437|    331|  } else
  438|  2.07k|#endif
  439|  2.07k|  {
  440|  2.07k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 92, False: 1.98k]
  ------------------
  441|     92|      return false;
  442|     92|    }
  443|  2.07k|  }
  444|       |
  445|  2.22k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.22k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.22k|                                           num_encoded_split_symbols);
  449|  2.22k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.22k|  DecoderBuffer traversal_end_buffer;
  452|  2.22k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 1.24k, False: 974]
  ------------------
  453|  1.24k|    return false;
  454|  1.24k|  }
  455|       |
  456|    974|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|    974|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 801, False: 173]
  ------------------
  458|    801|    return false;
  459|    801|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    173|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    173|                           traversal_end_buffer.remaining_size(),
  464|    173|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    173|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    173|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    173|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 6, False: 167]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      6|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      6|  }
  471|    173|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    173|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 148, False: 25]
  ------------------
  475|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    148|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 5, False: 143]
  ------------------
  477|     15|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 10, False: 5]
  ------------------
  478|     10|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 10]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|     10|      }
  482|       |
  483|      5|    } else
  484|    143|#endif
  485|    143|    {
  486|   310k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 310k, False: 143]
  ------------------
  487|   310k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 310k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   310k|      }
  491|    143|    }
  492|    148|  }
  493|    173|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    393|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 220, False: 173]
  ------------------
  498|    220|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   352k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 352k, False: 220]
  ------------------
  501|   352k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   352k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    220|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 220]
  ------------------
  505|    220|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    220|  }
  509|       |
  510|    173|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    393|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 220, False: 173]
  ------------------
  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|    220|    int32_t att_connectivity_verts =
  517|    220|        attribute_data_[i].connectivity_data.num_vertices();
  518|    220|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 3, False: 217]
  ------------------
  519|      3|      att_connectivity_verts = corner_table_->num_vertices();
  520|      3|    }
  521|    220|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    220|  }
  523|    173|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 17, False: 156]
  ------------------
  524|     17|    return false;
  525|     17|  }
  526|    156|  return true;
  527|    173|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     15|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     15|  return true;
  532|     15|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|    974|    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|    974|  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|    974|  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|    974|  std::vector<VertexIndex> invalid_vertices;
  558|    974|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|    974|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|    974|  int num_faces = 0;
  562|  38.8M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 38.8M, False: 285]
  ------------------
  563|  38.8M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  38.8M|    bool check_topology_split = false;
  566|  38.8M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  38.8M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 3.17M, False: 35.6M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  3.17M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 40, False: 3.17M]
  ------------------
  588|     40|        return -1;
  589|     40|      }
  590|       |
  591|  3.17M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  3.17M|      const VertexIndex vertex_x =
  593|  3.17M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  3.17M|      const CornerIndex corner_b =
  595|  3.17M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  3.17M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 324, False: 3.17M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    324|        return -1;
  600|    324|      }
  601|  3.17M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 3.17M]
  |  Branch (601:11): [True: 0, False: 3.17M]
  ------------------
  602|  3.17M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 3.17M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  3.17M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  3.17M|      SetOppositeCorners(corner_a, corner + 1);
  612|  3.17M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  3.17M|      const VertexIndex vert_a_prev =
  616|  3.17M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  3.17M|      const VertexIndex vert_b_next =
  618|  3.17M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  3.17M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 3.17M]
  |  Branch (619:38): [True: 0, False: 3.17M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  3.17M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  3.17M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  3.17M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  3.17M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  3.17M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  3.17M|      active_corner_stack.back() = corner;
  631|  35.6M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 2.14k, False: 35.6M]
  |  Branch (631:40): [True: 31.9M, False: 3.66M]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  31.9M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 31.9M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  31.9M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  31.9M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 31.9M]
  ------------------
  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|  31.9M|      const CornerIndex corner(3 * face.value());
  658|  31.9M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  31.9M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 2.14k, False: 31.9M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  2.14k|        opp_corner = corner + 2;
  662|  2.14k|        corner_l = corner + 1;
  663|  2.14k|        corner_r = corner;
  664|  31.9M|      } else {
  665|       |        // "l" is the new first corner.
  666|  31.9M|        opp_corner = corner + 1;
  667|  31.9M|        corner_l = corner;
  668|  31.9M|        corner_r = corner + 2;
  669|  31.9M|      }
  670|  31.9M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  31.9M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  31.9M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 14, False: 31.9M]
  ------------------
  675|     14|        return -1;  // Unexpected number of decoded vertices.
  676|     14|      }
  677|       |
  678|  31.9M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  31.9M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  31.9M|      const VertexIndex vertex_r =
  682|  31.9M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  31.9M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  31.9M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  31.9M|      corner_table_->MapCornerToVertex(
  688|  31.9M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  31.9M|      active_corner_stack.back() = corner;
  690|  31.9M|      check_topology_split = true;
  691|  31.9M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 36.1k, False: 3.62M]
  ------------------
  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|  36.1k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 36.1k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  36.1k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  36.1k|      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|  36.1k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  36.1k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 34, False: 36.0k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     34|        active_corner_stack.push_back(it->second);
  714|     34|      }
  715|  36.1k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 46, False: 36.0k]
  ------------------
  716|     46|        return -1;
  717|     46|      }
  718|  36.0k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  36.0k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 36.0k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  36.0k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 4, False: 36.0k]
  |  Branch (724:11): [True: 4, False: 36.0k]
  ------------------
  725|  36.0k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 36.0k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      4|        return -1;
  729|      4|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  36.0k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  36.0k|      SetOppositeCorners(corner_a, corner + 2);
  735|  36.0k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  36.0k|      const VertexIndex vertex_p =
  739|  36.0k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  36.0k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  36.0k|      corner_table_->MapCornerToVertex(
  742|  36.0k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  36.0k|      const VertexIndex vert_b_prev =
  744|  36.0k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  36.0k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  36.0k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  36.0k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  36.0k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  36.0k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  36.0k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  36.0k|                                       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|  36.0k|      const CornerIndex first_corner = corner_n;
  757|  10.3M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 10.2M, False: 36.0k]
  ------------------
  758|  10.2M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  10.2M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  10.2M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 10.2M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  10.2M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  36.0k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  36.0k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 35.9k, False: 68]
  ------------------
  770|  35.9k|        invalid_vertices.push_back(vertex_n);
  771|  35.9k|      }
  772|  36.0k|      active_corner_stack.back() = corner;
  773|  3.62M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 3.62M, False: 211]
  ------------------
  774|  3.62M|      const CornerIndex corner(3 * face.value());
  775|  3.62M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  3.62M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  3.62M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  3.62M|                                       corner_table_->AddNewVertex());
  780|  3.62M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  3.62M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  3.62M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 19, False: 3.62M]
  ------------------
  784|     19|        return -1;  // Unexpected number of decoded vertices.
  785|     19|      }
  786|       |
  787|  3.62M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  3.62M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  3.62M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  3.62M|      active_corner_stack.push_back(corner);
  792|  3.62M|      check_topology_split = true;
  793|  3.62M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    211|      return -1;
  796|    211|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  38.8M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  38.8M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 35.6M, False: 3.20M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  35.6M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  35.6M|      EdgeFaceName split_edge;
  812|  35.6M|      int encoder_split_symbol_id;
  813|  35.6M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.48k, False: 35.6M]
  ------------------
  814|  35.6M|                             &encoder_split_symbol_id)) {
  815|  1.48k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 29, False: 1.45k]
  ------------------
  816|     29|          return -1;  // Wrong split symbol id.
  817|     29|        }
  818|       |        // Symbol was part of a topology split. Now we need to determine which
  819|       |        // edge should be added to the active edges stack.
  820|  1.45k|        const CornerIndex act_top_corner = active_corner_stack.back();
  821|       |        // The current symbol has one active edge (stored in act_top_corner) and
  822|       |        // two remaining inactive edges that are attached to it.
  823|       |        //              *
  824|       |        //             / \
  825|       |        //  left_edge /   \ right_edge
  826|       |        //           /     \
  827|       |        //          *.......*
  828|       |        //         active_edge
  829|       |
  830|  1.45k|        CornerIndex new_active_corner;
  831|  1.45k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 527, False: 931]
  ------------------
  832|    527|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    931|        } else {
  834|    931|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    931|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.45k|        const int decoder_split_symbol_id =
  839|  1.45k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.45k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.45k|            new_active_corner;
  842|  1.45k|      }
  843|  35.6M|    }
  844|  38.8M|  }
  845|    285|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 285]
  ------------------
  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|  1.97M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 1.97M, False: 249]
  ------------------
  850|  1.97M|    const CornerIndex corner = active_corner_stack.back();
  851|  1.97M|    active_corner_stack.pop_back();
  852|  1.97M|    const bool interior_face =
  853|  1.97M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  1.97M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 1.92M, False: 50.9k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  1.92M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 31, False: 1.92M]
  ------------------
  877|     31|        return -1;  // More faces than expected added to the mesh.
  878|     31|      }
  879|       |
  880|  1.92M|      const CornerIndex corner_a = corner;
  881|  1.92M|      const VertexIndex vert_n =
  882|  1.92M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  1.92M|      const CornerIndex corner_b =
  884|  1.92M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  1.92M|      const VertexIndex vert_x =
  887|  1.92M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  1.92M|      const CornerIndex corner_c =
  889|  1.92M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  1.92M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 4, False: 1.92M]
  |  Branch (891:33): [True: 1, False: 1.92M]
  |  Branch (891:55): [True: 0, False: 1.92M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      5|        return -1;
  894|      5|      }
  895|  1.92M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 1.92M]
  |  Branch (895:11): [True: 0, False: 1.92M]
  ------------------
  896|  1.92M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 1.92M]
  ------------------
  897|  1.92M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 1.92M]
  ------------------
  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|  1.92M|      const VertexIndex vert_p =
  904|  1.92M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  1.92M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  1.92M|      const CornerIndex new_corner(3 * face.value());
  909|  1.92M|      SetOppositeCorners(new_corner, corner);
  910|  1.92M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  1.92M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  1.92M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  1.92M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  1.92M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  7.70M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 5.78M, False: 1.92M]
  ------------------
  920|  5.78M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  5.78M|      }
  922|       |
  923|  1.92M|      init_face_configurations_.push_back(true);
  924|  1.92M|      init_corners_.push_back(new_corner);
  925|  1.92M|    } 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|  50.9k|      init_face_configurations_.push_back(false);
  930|  50.9k|      init_corners_.push_back(corner);
  931|  50.9k|    }
  932|  1.97M|  }
  933|    249|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 72, False: 177]
  ------------------
  934|     72|    return -1;  // Unexpected number of decoded faces.
  935|     72|  }
  936|       |
  937|    177|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  3.50k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 3.50k, False: 173]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  3.50k|    VertexIndex src_vert(num_vertices - 1);
  943|  4.33k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 832, False: 3.50k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    832|      src_vert = VertexIndex(--num_vertices - 1);
  946|    832|    }
  947|  3.50k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 623, False: 2.88k]
  ------------------
  948|    623|      continue;  // No need to swap anything.
  949|    623|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.88k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  11.5k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 8.66k, False: 2.87k]
  ------------------
  954|  8.66k|      const CornerIndex cid = vcit.Corner();
  955|  8.66k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 4, False: 8.66k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      4|        return -1;
  959|      4|      }
  960|  8.66k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  8.66k|    }
  962|  2.87k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  2.87k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  2.87k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  2.87k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  2.87k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  2.87k|    num_vertices--;
  972|  2.87k|  }
  973|    173|  return num_vertices;
  974|    177|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.40k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.40k|  uint32_t num_topology_splits;
  982|  2.40k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.40k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.40k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 136, False: 2.27k]
  ------------------
  984|    136|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 2, False: 134]
  ------------------
  985|      2|      return -1;
  986|      2|    }
  987|       |
  988|    136|  } else
  989|  2.27k|#endif
  990|  2.27k|  {
  991|  2.27k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 14, False: 2.25k]
  ------------------
  992|     14|      return -1;
  993|     14|    }
  994|  2.27k|  }
  995|  2.39k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 479, False: 1.91k]
  ------------------
  996|    479|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 43, False: 436]
  ------------------
  997|    479|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     43|      return -1;
  999|     43|    }
 1000|    436|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    436|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    436|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 41, False: 395]
  ------------------
 1002|  54.7k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 54.7k, False: 10]
  ------------------
 1003|  54.7k|        TopologySplitEventData event_data;
 1004|  54.7k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 17, False: 54.7k]
  ------------------
 1005|     17|          return -1;
 1006|     17|        }
 1007|  54.7k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 10, False: 54.7k]
  ------------------
 1008|     10|          return -1;
 1009|     10|        }
 1010|  54.7k|        uint8_t edge_data;
 1011|  54.7k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 54.7k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|  54.7k|        event_data.source_edge = edge_data & 1;
 1015|  54.7k|        topology_split_data_.push_back(event_data);
 1016|  54.7k|      }
 1017|       |
 1018|     41|    } else
 1019|    395|#endif
 1020|    395|    {
 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|    395|      int last_source_symbol_id = 0;
 1024|  4.44k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 4.09k, False: 351]
  ------------------
 1025|  4.09k|        TopologySplitEventData event_data;
 1026|  4.09k|        uint32_t delta;
 1027|  4.09k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 17, False: 4.07k]
  ------------------
 1028|     17|          return -1;
 1029|     17|        }
 1030|  4.07k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  4.07k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 9, False: 4.06k]
  ------------------
 1032|      9|          return -1;
 1033|      9|        }
 1034|  4.06k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 18, False: 4.04k]
  ------------------
 1035|     18|          return -1;
 1036|     18|        }
 1037|  4.04k|        event_data.split_symbol_id =
 1038|  4.04k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.04k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.04k|        topology_split_data_.push_back(event_data);
 1041|  4.04k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    351|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.58k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 3.23k, False: 351]
  ------------------
 1045|  3.23k|        uint32_t edge_data;
 1046|  3.23k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.23k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 214, False: 3.02k]
  ------------------
 1047|    214|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.02k|        } else {
 1049|  3.02k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.02k|        }
 1051|  3.23k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  3.23k|        event_data.source_edge = edge_data & 1;
 1053|  3.23k|      }
 1054|    351|      decoder_buffer->EndBitDecoding();
 1055|    351|    }
 1056|    436|  }
 1057|  2.27k|  uint32_t num_hole_events = 0;
 1058|  2.27k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.27k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.27k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 98, False: 2.17k]
  ------------------
 1060|     98|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 2, False: 96]
  ------------------
 1061|      2|      return -1;
 1062|      2|    }
 1063|  2.17k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.17k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 168, False: 2.00k]
  ------------------
 1064|    168|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 11, False: 157]
  ------------------
 1065|     11|      return -1;
 1066|     11|    }
 1067|    168|  }
 1068|  2.26k|#endif
 1069|  2.26k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 57, False: 2.20k]
  ------------------
 1070|     57|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     57|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     57|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 26, False: 31]
  ------------------
 1072|   205k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 205k, False: 2]
  ------------------
 1073|   205k|        HoleEventData event_data;
 1074|   205k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 24, False: 205k]
  ------------------
 1075|     24|          return -1;
 1076|     24|        }
 1077|   205k|        hole_event_data_.push_back(event_data);
 1078|   205k|      }
 1079|       |
 1080|     26|    } else
 1081|     31|#endif
 1082|     31|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     31|      int last_symbol_id = 0;
 1085|    581|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 566, False: 15]
  ------------------
 1086|    566|        HoleEventData event_data;
 1087|    566|        uint32_t delta;
 1088|    566|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 16, False: 550]
  ------------------
 1089|     16|          return -1;
 1090|     16|        }
 1091|    550|        event_data.symbol_id = delta + last_symbol_id;
 1092|    550|        last_symbol_id = event_data.symbol_id;
 1093|    550|        hole_event_data_.push_back(event_data);
 1094|    550|      }
 1095|     31|    }
 1096|     57|  }
 1097|  2.22k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.26k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|     10|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|     10|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|     10|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     40|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 30, False: 10]
  ------------------
 1109|     30|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     30|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 10, False: 20]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     20|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 10, False: 10]
  ------------------
 1114|     10|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|     10|      }
 1116|     10|      continue;
 1117|     10|    }
 1118|       |
 1119|     40|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 20, False: 20]
  ------------------
 1120|     20|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     20|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 7, False: 13]
  ------------------
 1122|      7|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|      7|      }
 1124|     20|    }
 1125|     20|  }
 1126|     10|  return true;
 1127|     10|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   310k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   310k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   310k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   310k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.24M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 930k, False: 310k]
  ------------------
 1139|   930k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   930k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 181k, False: 748k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   363k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 181k, False: 181k]
  ------------------
 1144|   181k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   181k|      }
 1146|   181k|      continue;
 1147|   181k|    }
 1148|   748k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   748k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 374k, False: 374k]
  ------------------
 1151|   374k|      continue;
 1152|   374k|    }
 1153|       |
 1154|   749k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 374k, False: 374k]
  ------------------
 1155|   374k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   374k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 170k, False: 204k]
  ------------------
 1157|   170k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   170k|      }
 1159|   374k|    }
 1160|   374k|  }
 1161|   310k|  return true;
 1162|   310k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    173|    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|    173|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    173|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 25, False: 148]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|   107k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 107k, False: 25]
  ------------------
 1176|   107k|      Mesh::Face face;
 1177|   107k|      const CornerIndex start_corner(3 * f.value());
 1178|   429k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 322k, False: 107k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   322k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   322k|        face[c] = vert_id;
 1182|   322k|      }
 1183|   107k|      decoder_->mesh()->SetFace(f, face);
 1184|   107k|    }
 1185|     25|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     25|    return true;
 1187|     25|  }
 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|    148|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    148|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   246k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 246k, False: 131]
  ------------------
 1197|   246k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   246k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 50, False: 246k]
  ------------------
 1199|     50|      continue;  // Isolated vertex.
 1200|     50|    }
 1201|   246k|    CornerIndex deduplication_first_corner = c;
 1202|   246k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 180k, False: 65.9k]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|   180k|      deduplication_first_corner = c;
 1206|   180k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  74.2k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 65.9k, False: 8.30k]
  ------------------
 1210|  65.9k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 8.16k, False: 57.7k]
  ------------------
 1211|  8.16k|          continue;  // No seam for this attribute, ignore it.
 1212|  8.16k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|  57.7k|        const VertexIndex vert_id =
 1217|  57.7k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  57.7k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  57.7k|        bool seam_found = false;
 1220|  62.7k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 62.5k, False: 192]
  ------------------
 1221|  62.5k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 17, False: 62.5k]
  ------------------
 1222|     17|            return false;
 1223|     17|          }
 1224|  62.5k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 57.5k, False: 4.95k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  57.5k|            deduplication_first_corner = act_c;
 1227|  57.5k|            seam_found = true;
 1228|  57.5k|            break;
 1229|  57.5k|          }
 1230|  4.95k|          act_c = corner_table_->SwingRight(act_c);
 1231|  4.95k|        }
 1232|  57.7k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 57.5k, False: 192]
  ------------------
 1233|  57.5k|          break;  // No reason to process other attributes if we found a seam.
 1234|  57.5k|        }
 1235|  57.7k|      }
 1236|  65.9k|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|   245k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   245k|    corner_to_point_map[c.value()] =
 1246|   245k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   245k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   245k|    CornerIndex prev_c = c;
 1250|   245k|    c = corner_table_->SwingRight(c);
 1251|   848k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 667k, False: 180k]
  |  Branch (1251:40): [True: 602k, False: 65.5k]
  ------------------
 1252|   602k|      bool attribute_seam = false;
 1253|  1.10M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 602k, False: 498k]
  ------------------
 1254|   602k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 103k, False: 498k]
  ------------------
 1255|   602k|            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|   103k|          attribute_seam = true;
 1259|   103k|          break;
 1260|   103k|        }
 1261|   602k|      }
 1262|   602k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 103k, False: 498k]
  ------------------
 1263|   103k|        corner_to_point_map[c.value()] =
 1264|   103k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   103k|        point_to_corner_map.push_back(c.value());
 1266|   498k|      } else {
 1267|   498k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   498k|      }
 1269|   602k|      prev_c = c;
 1270|   602k|      c = corner_table_->SwingRight(c);
 1271|   602k|    }
 1272|   245k|  }
 1273|       |  // Add faces.
 1274|  93.9k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 93.7k, False: 131]
  ------------------
 1275|  93.7k|    Mesh::Face face;
 1276|   375k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 281k, False: 93.7k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   281k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   281k|    }
 1280|  93.7k|    decoder_->mesh()->SetFace(f, face);
 1281|  93.7k|  }
 1282|    131|  decoder_->point_cloud()->set_num_points(
 1283|    131|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    131|  return true;
 1285|    148|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    147|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    147|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    147|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    147|  const Mesh *mesh = decoder_->mesh();
  115|    147|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    147|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    147|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    147|                           encoding_data);
  120|       |
  121|    147|  TraverserT att_traverser;
  122|    147|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    147|  traversal_sequencer->SetTraverser(att_traverser);
  125|    147|  return std::move(traversal_sequencer);
  126|    147|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    748|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    748|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    748|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    748|  const Mesh *mesh = decoder_->mesh();
  115|    748|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    748|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    748|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    748|                           encoding_data);
  120|       |
  121|    748|  TraverserT att_traverser;
  122|    748|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    748|  traversal_sequencer->SetTraverser(att_traverser);
  125|    748|  return std::move(traversal_sequencer);
  126|    748|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    233|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    233|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    233|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    233|  const Mesh *mesh = decoder_->mesh();
  115|    233|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    233|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    233|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    233|                           encoding_data);
  120|       |
  121|    233|  TraverserT att_traverser;
  122|    233|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    233|  traversal_sequencer->SetTraverser(att_traverser);
  125|    233|  return std::move(traversal_sequencer);
  126|    233|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    687|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    687|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    687|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    687|  const Mesh *mesh = decoder_->mesh();
  115|    687|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    687|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    687|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    687|                           encoding_data);
  120|       |
  121|    687|  TraverserT att_traverser;
  122|    687|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    687|  traversal_sequencer->SetTraverser(att_traverser);
  125|    687|  return std::move(traversal_sequencer);
  126|    687|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     24|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     24|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     24|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     24|  const Mesh *mesh = decoder_->mesh();
  115|     24|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     24|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     24|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     24|                           encoding_data);
  120|       |
  121|     24|  TraverserT att_traverser;
  122|     24|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     24|  traversal_sequencer->SetTraverser(att_traverser);
  125|     24|  return std::move(traversal_sequencer);
  126|     24|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     32|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     32|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     32|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     32|  const Mesh *mesh = decoder_->mesh();
  115|     32|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     32|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     32|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     32|                           encoding_data);
  120|       |
  121|     32|  TraverserT att_traverser;
  122|     32|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     32|  traversal_sequencer->SetTraverser(att_traverser);
  125|     32|  return std::move(traversal_sequencer);
  126|     32|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  7.36k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.48k|  const CornerTable *GetCornerTable() const override {
   67|  2.48k|    return corner_table_.get();
   68|  2.48k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  3.33M|                       int *out_encoder_split_symbol_id) {
   87|  3.33M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 37.7k, False: 3.29M]
  ------------------
   88|  37.7k|      return false;
   89|  37.7k|    }
   90|  3.29M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 21, False: 3.29M]
  ------------------
   91|  3.29M|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     21|      *out_encoder_split_symbol_id = -1;
   98|     21|      return true;
   99|     21|    }
  100|  3.29M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 3.29M, False: 1.60k]
  ------------------
  101|  3.29M|      return false;
  102|  3.29M|    }
  103|  1.60k|    *out_face_edge =
  104|  1.60k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.60k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.60k|    topology_split_data_.pop_back();
  108|  1.60k|    return true;
  109|  3.29M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  9.94M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  9.94M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  9.94M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  9.94M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  13.9k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  6.86k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  4.44k|  const CornerTable *GetCornerTable() const override {
   67|  4.44k|    return corner_table_.get();
   68|  4.44k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  25.7M|                       int *out_encoder_split_symbol_id) {
   87|  25.7M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 25.7M, False: 61.3k]
  ------------------
   88|  25.7M|      return false;
   89|  25.7M|    }
   90|  61.3k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 27, False: 61.3k]
  ------------------
   91|  61.3k|        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|     27|      *out_encoder_split_symbol_id = -1;
   98|     27|      return true;
   99|     27|    }
  100|  61.3k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 59.9k, False: 1.44k]
  ------------------
  101|  59.9k|      return false;
  102|  59.9k|    }
  103|  1.44k|    *out_face_edge =
  104|  1.44k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.44k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.44k|    topology_split_data_.pop_back();
  108|  1.44k|    return true;
  109|  61.3k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  76.7M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  76.7M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  76.7M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  76.7M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  9.29k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  11.9k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.36k|  const CornerTable *GetCornerTable() const override {
   67|  2.36k|    return corner_table_.get();
   68|  2.36k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  35.6M|                       int *out_encoder_split_symbol_id) {
   87|  35.6M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 35.0M, False: 555k]
  ------------------
   88|  35.0M|      return false;
   89|  35.0M|    }
   90|   555k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 29, False: 555k]
  ------------------
   91|   555k|        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|     29|      *out_encoder_split_symbol_id = -1;
   98|     29|      return true;
   99|     29|    }
  100|   555k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 553k, False: 1.45k]
  ------------------
  101|   553k|      return false;
  102|   553k|    }
  103|  1.45k|    *out_face_edge =
  104|  1.45k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.45k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.45k|    topology_split_data_.pop_back();
  108|  1.45k|    return true;
  109|   555k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  44.1M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  44.1M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  44.1M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  44.1M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  13.5k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  8.41k|      : attribute_connectivity_decoders_(nullptr),
   34|  8.41k|        num_attribute_data_(0),
   35|  8.41k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  6.96k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  6.96k|    decoder_impl_ = decoder;
   38|  6.96k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  6.96k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  6.96k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  6.96k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  5.25k|  uint16_t BitstreamVersion() const {
   45|  5.25k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  5.25k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.45k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  6.96k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  4.74k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  4.74k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 163, False: 4.58k]
  ------------------
   63|    163|      return false;
   64|    163|    }
   65|       |
   66|  4.58k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 127, False: 4.45k]
  ------------------
   67|    127|      return false;
   68|    127|    }
   69|       |
   70|  4.45k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 27, False: 4.42k]
  ------------------
   71|     27|      return false;
   72|     27|    }
   73|  4.42k|    *out_buffer = buffer_;
   74|  4.42k|    return true;
   75|  4.45k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  2.01M|  inline bool DecodeStartFaceConfiguration() {
   79|  2.01M|    uint32_t face_configuration;
   80|  2.01M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  2.01M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.01M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 514, False: 2.01M]
  ------------------
   82|    514|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    514|    } else
   85|  2.01M|#endif
   86|  2.01M|    {
   87|  2.01M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  2.01M|    }
   89|  2.01M|    return face_configuration;
   90|  2.01M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  7.48M|  inline uint32_t DecodeSymbol() {
   94|  7.48M|    uint32_t symbol;
   95|  7.48M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  7.48M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 3.25M, False: 4.22M]
  ------------------
   97|  3.25M|      return symbol;
   98|  3.25M|    }
   99|       |    // Else decode two additional bits.
  100|  4.22M|    uint32_t symbol_suffix;
  101|  4.22M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  4.22M|    symbol |= (symbol_suffix << 1);
  103|  4.22M|    return symbol;
  104|  7.48M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  7.40M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|   856k|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  22.5M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  22.5M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  22.5M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  4.11k|  void Done() {
  123|  4.11k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 3.95k, False: 167]
  ------------------
  124|  3.95k|      symbol_buffer_.EndBitDecoding();
  125|  3.95k|    }
  126|  4.11k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  4.11k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.11k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 253, False: 3.86k]
  ------------------
  128|    253|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    253|    } else
  131|  3.86k|#endif
  132|  3.86k|    {
  133|  3.86k|      start_face_decoder_.EndDecoding();
  134|  3.86k|    }
  135|  4.11k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  1.99k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  4.97k|  bool DecodeTraversalSymbols() {
  141|  4.97k|    uint64_t traversal_size;
  142|  4.97k|    symbol_buffer_ = buffer_;
  143|  4.97k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 53, False: 4.92k]
  ------------------
  144|     53|      return false;
  145|     53|    }
  146|  4.92k|    buffer_ = symbol_buffer_;
  147|  4.92k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 178, False: 4.74k]
  ------------------
  148|    178|      return false;
  149|    178|    }
  150|  4.74k|    buffer_.Advance(traversal_size);
  151|  4.74k|    return true;
  152|  4.92k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  6.73k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  6.73k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  6.73k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.73k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 535, False: 6.19k]
  ------------------
  158|    535|      start_face_buffer_ = buffer_;
  159|    535|      uint64_t traversal_size;
  160|    535|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 7, False: 528]
  ------------------
  161|      7|        return false;
  162|      7|      }
  163|    528|      buffer_ = start_face_buffer_;
  164|    528|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 195, False: 333]
  ------------------
  165|    195|        return false;
  166|    195|      }
  167|    333|      buffer_.Advance(traversal_size);
  168|    333|      return true;
  169|    528|    }
  170|  6.19k|#endif
  171|  6.19k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  6.73k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  6.47k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  6.47k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 4.31k, False: 2.16k]
  ------------------
  177|  4.31k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  4.31k|          new BinaryDecoder[num_attribute_data_]);
  179|  12.0k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 7.80k, False: 4.26k]
  ------------------
  180|  7.80k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 52, False: 7.74k]
  ------------------
  181|     52|          return false;
  182|     52|        }
  183|  7.80k|      }
  184|  4.31k|    }
  185|  6.42k|    return true;
  186|  6.47k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  4.42k|MeshSequentialDecoder::MeshSequentialDecoder() {}
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  4.25k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  4.25k|  uint32_t num_faces;
   31|  4.25k|  uint32_t num_points;
   32|  4.25k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  4.25k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.25k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 727, False: 3.52k]
  ------------------
   34|    727|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 9, False: 718]
  ------------------
   35|      9|      return false;
   36|      9|    }
   37|    718|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 5, False: 713]
  ------------------
   38|      5|      return false;
   39|      5|    }
   40|       |
   41|    718|  } else
   42|  3.52k|#endif
   43|  3.52k|  {
   44|  3.52k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 16, False: 3.51k]
  ------------------
   45|     16|      return false;
   46|     16|    }
   47|  3.51k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 8, False: 3.50k]
  ------------------
   48|      8|      return false;
   49|      8|    }
   50|  3.51k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  4.21k|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|  4.21k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 4, False: 4.21k]
  ------------------
   56|      4|    return false;
   57|      4|  }
   58|  4.21k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 34, False: 4.17k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|     34|    return false;
   62|     34|  }
   63|  4.17k|  uint8_t connectivity_method;
   64|  4.17k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 3, False: 4.17k]
  ------------------
   65|      3|    return false;
   66|      3|  }
   67|  4.17k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 3.69k, False: 481]
  ------------------
   68|  3.69k|    if (!DecodeAndDecompressIndices(num_faces, num_points)) {
  ------------------
  |  Branch (68:9): [True: 3.60k, False: 87]
  ------------------
   69|  3.60k|      return false;
   70|  3.60k|    }
   71|  3.69k|  } else {
   72|    481|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 262, False: 219]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|    523|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 297, False: 226]
  ------------------
   75|    297|        Mesh::Face face;
   76|  1.10k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 841, False: 261]
  ------------------
   77|    841|          uint8_t val;
   78|    841|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 1, False: 840]
  ------------------
   79|      1|            return false;
   80|      1|          }
   81|    840|          if (val >= num_points) {
  ------------------
  |  Branch (81:15): [True: 35, False: 805]
  ------------------
   82|     35|            return false;
   83|     35|          }
   84|    805|          face[j] = val;
   85|    805|        }
   86|    261|        mesh()->AddFace(face);
   87|    261|      }
   88|    262|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (88:16): [True: 56, False: 163]
  ------------------
   89|       |      // Decode indices as uint16_t.
   90|     89|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:28): [True: 73, False: 16]
  ------------------
   91|     73|        Mesh::Face face;
   92|    213|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (92:25): [True: 180, False: 33]
  ------------------
   93|    180|          uint16_t val;
   94|    180|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (94:15): [True: 4, False: 176]
  ------------------
   95|      4|            return false;
   96|      4|          }
   97|    176|          if (val >= num_points) {
  ------------------
  |  Branch (97:15): [True: 36, False: 140]
  ------------------
   98|     36|            return false;
   99|     36|          }
  100|    140|          face[j] = val;
  101|    140|        }
  102|     33|        mesh()->AddFace(face);
  103|     33|      }
  104|    163|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (104:16): [True: 53, False: 110]
  ------------------
  105|     53|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     53|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (105:16): [True: 43, False: 10]
  ------------------
  106|       |      // Decode indices as uint32_t.
  107|    513|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (107:28): [True: 494, False: 19]
  ------------------
  108|    494|        Mesh::Face face;
  109|  1.93k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (109:25): [True: 1.46k, False: 470]
  ------------------
  110|  1.46k|          uint32_t val;
  111|  1.46k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (111:15): [True: 11, False: 1.45k]
  ------------------
  112|     11|            return false;
  113|     11|          }
  114|  1.45k|          if (val >= num_points) {
  ------------------
  |  Branch (114:15): [True: 13, False: 1.44k]
  ------------------
  115|     13|            return false;
  116|     13|          }
  117|  1.44k|          face[j] = val;
  118|  1.44k|        }
  119|    470|        mesh()->AddFace(face);
  120|    470|      }
  121|    120|    } else {
  122|       |      // Decode faces as uint32_t (default).
  123|    430|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (123:28): [True: 392, False: 38]
  ------------------
  124|    392|        Mesh::Face face;
  125|  1.37k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (125:25): [True: 1.06k, False: 310]
  ------------------
  126|  1.06k|          uint32_t val;
  127|  1.06k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (127:15): [True: 25, False: 1.04k]
  ------------------
  128|     25|            return false;
  129|     25|          }
  130|  1.04k|          if (val >= num_points) {
  ------------------
  |  Branch (130:15): [True: 57, False: 987]
  ------------------
  131|     57|            return false;
  132|     57|          }
  133|    987|          face[j] = val;
  134|    987|        }
  135|    310|        mesh()->AddFace(face);
  136|    310|      }
  137|    120|    }
  138|    481|  }
  139|    386|  point_cloud()->set_num_points(num_points);
  140|    386|  return true;
  141|  4.17k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  143|  11.5k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  144|       |  // Always create the basic attribute decoder.
  145|  11.5k|  return SetAttributesDecoder(
  146|  11.5k|      att_decoder_id,
  147|  11.5k|      std::unique_ptr<AttributesDecoder>(
  148|  11.5k|          new SequentialAttributeDecodersController(
  149|  11.5k|              std::unique_ptr<PointsSequencer>(
  150|  11.5k|                  new LinearSequencer(point_cloud()->num_points())))));
  151|  11.5k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEjj:
  154|  3.69k|                                                       uint32_t num_points) {
  155|       |  // Get decoded indices differences that were encoded with an entropy code.
  156|  3.69k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  157|  3.69k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (157:7): [True: 3.49k, False: 200]
  ------------------
  158|  3.49k|    return false;
  159|  3.49k|  }
  160|       |  // Reconstruct the indices from the differences.
  161|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  162|    200|  int32_t last_index_value = 0;  // This will always be >= 0.
  163|    200|  int vertex_index = 0;
  164|    390|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (164:24): [True: 303, False: 87]
  ------------------
  165|    303|    Mesh::Face face;
  166|    888|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (166:21): [True: 698, False: 190]
  ------------------
  167|    698|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  168|    698|      int32_t index_diff = (encoded_val >> 1);
  169|    698|      if (encoded_val & 1) {
  ------------------
  |  Branch (169:11): [True: 301, False: 397]
  ------------------
  170|    301|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (170:13): [True: 46, False: 255]
  ------------------
  171|       |          // Subtracting index_diff would result in a negative index.
  172|     46|          return false;
  173|     46|        }
  174|    255|        index_diff = -index_diff;
  175|    397|      } else {
  176|    397|        if (index_diff >
  ------------------
  |  Branch (176:13): [True: 0, False: 397]
  ------------------
  177|    397|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  178|       |          // Adding index_diff to last_index_value would overflow.
  179|      0|          return false;
  180|      0|        }
  181|    397|      }
  182|    652|      const int32_t index_value = index_diff + last_index_value;
  183|    652|      if (index_value < 0 ||
  ------------------
  |  Branch (183:11): [True: 0, False: 652]
  ------------------
  184|    652|          static_cast<uint32_t>(index_value) >= num_points) {
  ------------------
  |  Branch (184:11): [True: 67, False: 585]
  ------------------
  185|     67|        return false;
  186|     67|      }
  187|    585|      face[j] = index_value;
  188|    585|      last_index_value = index_value;
  189|    585|    }
  190|    190|    mesh()->AddFace(face);
  191|    190|  }
  192|     87|  return true;
  193|    200|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.40k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.03M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.03M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 3.02M, False: 5.01k]
  ------------------
   61|  3.02M|      return true;  // Already traversed.
   62|  3.02M|    }
   63|       |
   64|  5.01k|    corner_traversal_stack_.clear();
   65|  5.01k|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  5.01k|    const VertexIndex next_vert =
   69|  5.01k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  5.01k|    const VertexIndex prev_vert =
   71|  5.01k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  5.01k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 5.01k]
  |  Branch (72:45): [True: 0, False: 5.01k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  5.01k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 4.00k, False: 1.01k]
  ------------------
   76|  4.00k|      this->MarkVertexVisited(next_vert);
   77|  4.00k|      this->traversal_observer().OnNewVertexVisited(
   78|  4.00k|          next_vert, this->corner_table()->Next(corner_id));
   79|  4.00k|    }
   80|  5.01k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 4.32k, False: 683]
  ------------------
   81|  4.32k|      this->MarkVertexVisited(prev_vert);
   82|  4.32k|      this->traversal_observer().OnNewVertexVisited(
   83|  4.32k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  4.32k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  29.0k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 24.0k, False: 5.01k]
  ------------------
   88|       |      // Currently processed corner.
   89|  24.0k|      corner_id = corner_traversal_stack_.back();
   90|  24.0k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  24.0k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 24.0k]
  |  Branch (92:47): [True: 938, False: 23.1k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    938|        corner_traversal_stack_.pop_back();
   95|    938|        continue;
   96|    938|      }
   97|  3.03M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.03M, Folded]
  ------------------
   98|  3.03M|        this->MarkFaceVisited(face_id);
   99|  3.03M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.03M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.03M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.03M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.03M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.53M, False: 1.49M]
  ------------------
  105|  1.53M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.53M|          this->MarkVertexVisited(vert_id);
  107|  1.53M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.53M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.49M, False: 40.1k]
  ------------------
  109|  1.49M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.49M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.49M|            continue;
  112|  1.49M|          }
  113|  1.53M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  1.53M|        const CornerIndex right_corner_id =
  118|  1.53M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.53M|        const CornerIndex left_corner_id =
  120|  1.53M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.53M|        const FaceIndex right_face_id(
  122|  1.53M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 29.0k, False: 1.51M]
  ------------------
  123|  1.53M|                 ? kInvalidFaceIndex
  124|  1.53M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.53M|        const FaceIndex left_face_id(
  126|  1.53M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 14.7k, False: 1.52M]
  ------------------
  127|  1.53M|                 ? kInvalidFaceIndex
  128|  1.53M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.53M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.49M, False: 39.8k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.49M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 13.5k, False: 1.48M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  13.5k|            corner_traversal_stack_.pop_back();
  134|  13.5k|            break;  // Break from the while (true) loop.
  135|  1.48M|          } else {
  136|       |            // Go to the left face.
  137|  1.48M|            corner_id = left_corner_id;
  138|  1.48M|            face_id = left_face_id;
  139|  1.48M|          }
  140|  1.49M|        } else {
  141|       |          // Right face was not visited.
  142|  39.8k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 30.3k, False: 9.52k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  30.3k|            corner_id = right_corner_id;
  145|  30.3k|            face_id = right_face_id;
  146|  30.3k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  9.52k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  9.52k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  9.52k|            break;
  159|  9.52k|          }
  160|  39.8k|        }
  161|  1.53M|      }
  162|  23.1k|    }
  163|  5.01k|    return true;
  164|  5.01k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.40k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.93k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.70k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  4.07M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  4.07M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 963k, False: 3.11M]
  ------------------
   61|   963k|      return true;  // Already traversed.
   62|   963k|    }
   63|       |
   64|  3.11M|    corner_traversal_stack_.clear();
   65|  3.11M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  3.11M|    const VertexIndex next_vert =
   69|  3.11M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.11M|    const VertexIndex prev_vert =
   71|  3.11M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.11M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.11M]
  |  Branch (72:45): [True: 0, False: 3.11M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.11M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 3.11M, False: 1.71k]
  ------------------
   76|  3.11M|      this->MarkVertexVisited(next_vert);
   77|  3.11M|      this->traversal_observer().OnNewVertexVisited(
   78|  3.11M|          next_vert, this->corner_table()->Next(corner_id));
   79|  3.11M|    }
   80|  3.11M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.11M, False: 1.49k]
  ------------------
   81|  3.11M|      this->MarkVertexVisited(prev_vert);
   82|  3.11M|      this->traversal_observer().OnNewVertexVisited(
   83|  3.11M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.11M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  6.29M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 3.18M, False: 3.11M]
  ------------------
   88|       |      // Currently processed corner.
   89|  3.18M|      corner_id = corner_traversal_stack_.back();
   90|  3.18M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  3.18M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 3.18M]
  |  Branch (92:47): [True: 5.94k, False: 3.18M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  5.94k|        corner_traversal_stack_.pop_back();
   95|  5.94k|        continue;
   96|  5.94k|      }
   97|  4.07M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 4.07M, Folded]
  ------------------
   98|  4.07M|        this->MarkFaceVisited(face_id);
   99|  4.07M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  4.07M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  4.07M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 4.07M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  4.07M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.61M, False: 459k]
  ------------------
  105|  3.61M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.61M|          this->MarkVertexVisited(vert_id);
  107|  3.61M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.61M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 443k, False: 3.17M]
  ------------------
  109|   443k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   443k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   443k|            continue;
  112|   443k|          }
  113|  3.61M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  3.63M|        const CornerIndex right_corner_id =
  118|  3.63M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.63M|        const CornerIndex left_corner_id =
  120|  3.63M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.63M|        const FaceIndex right_face_id(
  122|  3.63M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 3.14M, False: 487k]
  ------------------
  123|  3.63M|                 ? kInvalidFaceIndex
  124|  3.63M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.63M|        const FaceIndex left_face_id(
  126|  3.63M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 3.14M, False: 492k]
  ------------------
  127|  3.63M|                 ? kInvalidFaceIndex
  128|  3.63M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.63M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.57M, False: 57.3k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.57M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 3.14M, False: 431k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  3.14M|            corner_traversal_stack_.pop_back();
  134|  3.14M|            break;  // Break from the while (true) loop.
  135|  3.14M|          } else {
  136|       |            // Go to the left face.
  137|   431k|            corner_id = left_corner_id;
  138|   431k|            face_id = left_face_id;
  139|   431k|          }
  140|  3.57M|        } else {
  141|       |          // Right face was not visited.
  142|  57.3k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 20.5k, False: 36.7k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  20.5k|            corner_id = right_corner_id;
  145|  20.5k|            face_id = right_face_id;
  146|  36.7k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  36.7k|            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|  36.7k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  36.7k|            break;
  159|  36.7k|          }
  160|  57.3k|        }
  161|  3.63M|      }
  162|  3.18M|    }
  163|  3.11M|    return true;
  164|  3.11M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.70k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.52k|  DepthFirstTraverser() {}

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

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

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

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.52k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  37.4M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  19.4M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  19.4M|    return is_vertex_visited_[vert_id.value()];
   65|  19.4M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  3.05M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  3.05M|    is_vertex_visited_[vert_id.value()] = true;
   68|  3.05M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  9.06M|  inline TraversalObserverT &traversal_observer() {
   75|  9.06M|    return traversal_observer_;
   76|  9.06M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  14.7M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  14.7M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 82.5k, False: 14.6M]
  ------------------
   47|  82.5k|      return true;  // Invalid faces are always considered as visited.
   48|  82.5k|    }
   49|  14.6M|    return is_face_visited_[face_id.value()];
   50|  14.7M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  6.01M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  6.01M|    is_face_visited_[face_id.value()] = true;
   62|  6.01M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.74k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.74k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.87k|                    TraversalObserver traversal_observer) {
   37|  1.87k|    corner_table_ = corner_table;
   38|  1.87k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.87k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.87k|    traversal_observer_ = traversal_observer;
   41|  1.87k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.03M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.03M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.03M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.03M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.03M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  34.0M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  4.07M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  4.07M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 4.07M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  4.07M|    return is_face_visited_[corner_id.value() / 3];
   58|  4.07M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  10.3M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  10.3M|    return is_vertex_visited_[vert_id.value()];
   65|  10.3M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  9.84M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  9.84M|    is_vertex_visited_[vert_id.value()] = true;
   68|  9.84M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  13.9M|  inline TraversalObserverT &traversal_observer() {
   75|  13.9M|    return traversal_observer_;
   76|  13.9M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  10.4M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  10.4M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 6.28M, False: 4.16M]
  ------------------
   47|  6.28M|      return true;  // Invalid faces are always considered as visited.
   48|  6.28M|    }
   49|  4.16M|    return is_face_visited_[face_id.value()];
   50|  10.4M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.07M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.07M|    is_face_visited_[face_id.value()] = true;
   62|  4.07M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.52k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.76k|                    TraversalObserver traversal_observer) {
   37|  1.76k|    corner_table_ = corner_table;
   38|  1.76k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.76k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.76k|    traversal_observer_ = traversal_observer;
   41|  1.76k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    361|      : bit_length_(0),
   87|    361|        num_points_(0),
   88|    361|        num_decoded_points_(0),
   89|    361|        dimension_(dimension),
   90|    361|        p_(dimension, 0),
   91|    361|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    361|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    361|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    243|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    243|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 13, False: 230]
  ------------------
  187|     13|    return false;
  188|     13|  }
  189|    230|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 16, False: 214]
  ------------------
  190|     16|    return false;
  191|     16|  }
  192|    214|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 11, False: 203]
  ------------------
  193|     11|    return false;
  194|     11|  }
  195|    203|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 71, False: 132]
  ------------------
  196|     71|    return true;
  197|     71|  }
  198|    132|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 84, False: 48]
  ------------------
  199|     84|    return false;
  200|     84|  }
  201|     48|  num_decoded_points_ = 0;
  202|       |
  203|     48|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 6, False: 42]
  ------------------
  204|      6|    return false;
  205|      6|  }
  206|     42|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 38]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     38|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 38]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     38|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 37]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     37|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 24, False: 13]
  ------------------
  217|     24|    return false;
  218|     24|  }
  219|       |
  220|     13|  numbers_decoder_.EndDecoding();
  221|     13|  remaining_bits_decoder_.EndDecoding();
  222|     13|  axis_decoder_.EndDecoding();
  223|     13|  half_decoder_.EndDecoding();
  224|       |
  225|     13|  return true;
  226|     37|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     37|    uint32_t num_points, OutputIteratorT &oit) {
  254|     37|  typedef DecodingStatus Status;
  255|     37|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     37|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     37|  DecodingStatus init_status(num_points, 0, 0);
  258|     37|  std::stack<Status> status_stack;
  259|     37|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  5.27M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 5.27M, False: 13]
  ------------------
  263|  5.27M|    const DecodingStatus status = status_stack.top();
  264|  5.27M|    status_stack.pop();
  265|       |
  266|  5.27M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  5.27M|    const uint32_t last_axis = status.last_axis;
  268|  5.27M|    const uint32_t stack_pos = status.stack_pos;
  269|  5.27M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  5.27M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  5.27M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 5.27M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  5.27M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  5.27M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 5.27M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  5.27M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  5.27M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.63M, False: 2.63M]
  ------------------
  285|  12.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 10.2M, False: 2.63M]
  ------------------
  286|  10.2M|        *oit = old_base;
  287|  10.2M|        ++oit;
  288|  10.2M|        ++num_decoded_points_;
  289|  10.2M|      }
  290|  2.63M|      continue;
  291|  2.63M|    }
  292|       |
  293|  2.63M|    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.63M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 389, False: 2.63M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    389|      axes_[0] = axis;
  300|    944|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 555, False: 389]
  ------------------
  301|    555|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    555|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 82, False: 473]
  |  |  ------------------
  ------------------
  302|    555|      }
  303|  1.04k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 668, False: 376]
  ------------------
  304|  2.22k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 1.57k, False: 655]
  ------------------
  305|  1.57k|          p_[axes_[j]] = 0;
  306|  1.57k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  1.57k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 880, False: 690]
  ------------------
  308|    880|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 13, False: 867]
  ------------------
  309|    880|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     13|              return false;
  311|     13|            }
  312|    880|          }
  313|  1.55k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  1.55k|        }
  315|    655|        *oit = p_;
  316|    655|        ++oit;
  317|    655|        ++num_decoded_points_;
  318|    655|      }
  319|    376|      continue;
  320|    389|    }
  321|       |
  322|  2.63M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.63M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.63M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.63M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.63M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.63M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.63M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.63M|    uint32_t number = 0;
  334|  2.63M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.63M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.63M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 11, False: 2.63M]
  ------------------
  338|       |      // Invalid |number|.
  339|     11|      return false;
  340|     11|    }
  341|  2.63M|    first_half -= number;
  342|  2.63M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.63M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.41M, False: 1.22M]
  ------------------
  345|  1.41M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.40M, False: 1.71k]
  ------------------
  346|  1.40M|        std::swap(first_half, second_half);
  347|  1.40M|      }
  348|  1.41M|    }
  349|       |
  350|  2.63M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.63M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.63M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.63M, False: 5]
  ------------------
  353|  2.63M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.63M|    }
  355|  2.63M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.63M, False: 30]
  ------------------
  356|  2.63M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.63M|    }
  358|  2.63M|  }
  359|     13|  return true;
  360|     37|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  6.13M|        : num_remaining_points(num_remaining_points_),
  135|  6.13M|          last_axis(last_axis_),
  136|  6.13M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  3.06M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  3.06M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  3.06M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     84|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    288|      : bit_length_(0),
   87|    288|        num_points_(0),
   88|    288|        num_decoded_points_(0),
   89|    288|        dimension_(dimension),
   90|    288|        p_(dimension, 0),
   91|    288|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    288|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    288|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    194|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    194|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 7, False: 187]
  ------------------
  187|      7|    return false;
  188|      7|  }
  189|    187|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 18, False: 169]
  ------------------
  190|     18|    return false;
  191|     18|  }
  192|    169|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 166]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    166|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 41, False: 125]
  ------------------
  196|     41|    return true;
  197|     41|  }
  198|    125|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 89, False: 36]
  ------------------
  199|     89|    return false;
  200|     89|  }
  201|     36|  num_decoded_points_ = 0;
  202|       |
  203|     36|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 7, False: 29]
  ------------------
  204|      7|    return false;
  205|      7|  }
  206|     29|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 27]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     27|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 27]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     27|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 27]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     27|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 22, False: 5]
  ------------------
  217|     22|    return false;
  218|     22|  }
  219|       |
  220|      5|  numbers_decoder_.EndDecoding();
  221|      5|  remaining_bits_decoder_.EndDecoding();
  222|      5|  axis_decoder_.EndDecoding();
  223|      5|  half_decoder_.EndDecoding();
  224|       |
  225|      5|  return true;
  226|     27|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     27|    uint32_t num_points, OutputIteratorT &oit) {
  254|     27|  typedef DecodingStatus Status;
  255|     27|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     27|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     27|  DecodingStatus init_status(num_points, 0, 0);
  258|     27|  std::stack<Status> status_stack;
  259|     27|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.10M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.10M, False: 5]
  ------------------
  263|  2.10M|    const DecodingStatus status = status_stack.top();
  264|  2.10M|    status_stack.pop();
  265|       |
  266|  2.10M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.10M|    const uint32_t last_axis = status.last_axis;
  268|  2.10M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.10M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.10M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.10M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.10M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.10M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.10M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.10M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.10M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.10M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.05M, False: 1.05M]
  ------------------
  285|  3.76M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 2.71M, False: 1.05M]
  ------------------
  286|  2.71M|        *oit = old_base;
  287|  2.71M|        ++oit;
  288|  2.71M|        ++num_decoded_points_;
  289|  2.71M|      }
  290|  1.05M|      continue;
  291|  1.05M|    }
  292|       |
  293|  1.05M|    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.05M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 455, False: 1.05M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    455|      axes_[0] = axis;
  300|  2.60k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.15k, False: 455]
  ------------------
  301|  2.15k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.15k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 261, False: 1.88k]
  |  |  ------------------
  ------------------
  302|  2.15k|      }
  303|  1.18k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 746, False: 441]
  ------------------
  304|  4.95k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.21k, False: 732]
  ------------------
  305|  4.21k|          p_[axes_[j]] = 0;
  306|  4.21k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.21k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.54k, False: 2.67k]
  ------------------
  308|  1.54k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 14, False: 1.53k]
  ------------------
  309|  1.54k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     14|              return false;
  311|     14|            }
  312|  1.54k|          }
  313|  4.20k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.20k|        }
  315|    732|        *oit = p_;
  316|    732|        ++oit;
  317|    732|        ++num_decoded_points_;
  318|    732|      }
  319|    441|      continue;
  320|    455|    }
  321|       |
  322|  1.05M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.05M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.05M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.05M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.05M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.05M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.05M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.05M|    uint32_t number = 0;
  334|  1.05M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.05M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.05M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 8, False: 1.05M]
  ------------------
  338|       |      // Invalid |number|.
  339|      8|      return false;
  340|      8|    }
  341|  1.05M|    first_half -= number;
  342|  1.05M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.05M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 559k, False: 491k]
  ------------------
  345|   559k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 559k, False: 638]
  ------------------
  346|   559k|        std::swap(first_half, second_half);
  347|   559k|      }
  348|   559k|    }
  349|       |
  350|  1.05M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.05M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.05M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.05M, False: 5]
  ------------------
  353|  1.05M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.05M|    }
  355|  1.05M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.05M, False: 38]
  ------------------
  356|  1.05M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.05M|    }
  358|  1.05M|  }
  359|      5|  return true;
  360|     27|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  4.52M|        : num_remaining_points(num_remaining_points_),
  135|  4.52M|          last_axis(last_axis_),
  136|  4.52M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.52M|    uint32_t last_axis) {
  232|  4.52M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.52M, Folded]
  ------------------
  233|  4.52M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.52M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.78M, False: 1.73M]
  |  |  ------------------
  ------------------
  234|  4.52M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.52M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  2.26M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.26M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.26M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     46|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    264|      : bit_length_(0),
   87|    264|        num_points_(0),
   88|    264|        num_decoded_points_(0),
   89|    264|        dimension_(dimension),
   90|    264|        p_(dimension, 0),
   91|    264|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    264|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    264|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    172|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    172|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 5, False: 167]
  ------------------
  187|      5|    return false;
  188|      5|  }
  189|    167|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 19, False: 148]
  ------------------
  190|     19|    return false;
  191|     19|  }
  192|    148|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 146]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    146|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 20, False: 126]
  ------------------
  196|     20|    return true;
  197|     20|  }
  198|    126|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 98, False: 28]
  ------------------
  199|     98|    return false;
  200|     98|  }
  201|     28|  num_decoded_points_ = 0;
  202|       |
  203|     28|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 23]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     23|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 23]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     23|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 22]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     22|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 19]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     19|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 13, False: 6]
  ------------------
  217|     13|    return false;
  218|     13|  }
  219|       |
  220|      6|  numbers_decoder_.EndDecoding();
  221|      6|  remaining_bits_decoder_.EndDecoding();
  222|      6|  axis_decoder_.EndDecoding();
  223|      6|  half_decoder_.EndDecoding();
  224|       |
  225|      6|  return true;
  226|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     19|    uint32_t num_points, OutputIteratorT &oit) {
  254|     19|  typedef DecodingStatus Status;
  255|     19|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     19|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     19|  DecodingStatus init_status(num_points, 0, 0);
  258|     19|  std::stack<Status> status_stack;
  259|     19|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  18.8k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 18.7k, False: 6]
  ------------------
  263|  18.7k|    const DecodingStatus status = status_stack.top();
  264|  18.7k|    status_stack.pop();
  265|       |
  266|  18.7k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  18.7k|    const uint32_t last_axis = status.last_axis;
  268|  18.7k|    const uint32_t stack_pos = status.stack_pos;
  269|  18.7k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  18.7k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  18.7k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 18.7k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  18.7k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  18.7k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 18.7k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  18.7k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  18.7k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 12, False: 18.7k]
  ------------------
  285|  1.58k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.57k, False: 12]
  ------------------
  286|  1.57k|        *oit = old_base;
  287|  1.57k|        ++oit;
  288|  1.57k|        ++num_decoded_points_;
  289|  1.57k|      }
  290|     12|      continue;
  291|     12|    }
  292|       |
  293|  18.7k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  18.7k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 36, False: 18.7k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     36|      axes_[0] = axis;
  300|     70|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 34, False: 36]
  ------------------
  301|     34|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|     34|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 9, False: 25]
  |  |  ------------------
  ------------------
  302|     34|      }
  303|     91|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 59, False: 32]
  ------------------
  304|    170|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 115, False: 55]
  ------------------
  305|    115|          p_[axes_[j]] = 0;
  306|    115|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    115|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 115, False: 0]
  ------------------
  308|    115|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 4, False: 111]
  ------------------
  309|    115|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      4|              return false;
  311|      4|            }
  312|    115|          }
  313|    111|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    111|        }
  315|     55|        *oit = p_;
  316|     55|        ++oit;
  317|     55|        ++num_decoded_points_;
  318|     55|      }
  319|     32|      continue;
  320|     36|    }
  321|       |
  322|  18.7k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 18.7k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  18.7k|    const int num_remaining_bits = bit_length_ - level;
  327|  18.7k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  18.7k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  18.7k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  18.7k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  18.7k|    uint32_t number = 0;
  334|  18.7k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  18.7k|    uint32_t first_half = num_remaining_points / 2;
  337|  18.7k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 9, False: 18.7k]
  ------------------
  338|       |      // Invalid |number|.
  339|      9|      return false;
  340|      9|    }
  341|  18.7k|    first_half -= number;
  342|  18.7k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  18.7k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 18.6k, False: 44]
  ------------------
  345|  18.6k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 16.5k, False: 2.11k]
  ------------------
  346|  16.5k|        std::swap(first_half, second_half);
  347|  16.5k|      }
  348|  18.6k|    }
  349|       |
  350|  18.7k|    levels_stack_[stack_pos][axis] += 1;
  351|  18.7k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  18.7k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 16.6k, False: 2.08k]
  ------------------
  353|  16.6k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  16.6k|    }
  355|  18.7k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.23k, False: 16.5k]
  ------------------
  356|  2.23k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.23k|    }
  358|  18.7k|  }
  359|      6|  return true;
  360|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  37.0k|        : num_remaining_points(num_remaining_points_),
  135|  37.0k|          last_axis(last_axis_),
  136|  37.0k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  27.9k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  27.9k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  27.9k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|     26|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    296|      : bit_length_(0),
   87|    296|        num_points_(0),
   88|    296|        num_decoded_points_(0),
   89|    296|        dimension_(dimension),
   90|    296|        p_(dimension, 0),
   91|    296|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    296|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    296|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    178|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    178|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 177]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    177|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 19, False: 158]
  ------------------
  190|     19|    return false;
  191|     19|  }
  192|    158|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 156]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    156|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 19, False: 137]
  ------------------
  196|     19|    return true;
  197|     19|  }
  198|    137|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 98, False: 39]
  ------------------
  199|     98|    return false;
  200|     98|  }
  201|     39|  num_decoded_points_ = 0;
  202|       |
  203|     39|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 36]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|     36|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 6, False: 30]
  ------------------
  207|      6|    return false;
  208|      6|  }
  209|     30|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 29]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     29|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 28]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     28|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 22, False: 6]
  ------------------
  217|     22|    return false;
  218|     22|  }
  219|       |
  220|      6|  numbers_decoder_.EndDecoding();
  221|      6|  remaining_bits_decoder_.EndDecoding();
  222|      6|  axis_decoder_.EndDecoding();
  223|      6|  half_decoder_.EndDecoding();
  224|       |
  225|      6|  return true;
  226|     28|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     28|    uint32_t num_points, OutputIteratorT &oit) {
  254|     28|  typedef DecodingStatus Status;
  255|     28|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     28|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     28|  DecodingStatus init_status(num_points, 0, 0);
  258|     28|  std::stack<Status> status_stack;
  259|     28|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  13.3k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 13.2k, False: 6]
  ------------------
  263|  13.2k|    const DecodingStatus status = status_stack.top();
  264|  13.2k|    status_stack.pop();
  265|       |
  266|  13.2k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  13.2k|    const uint32_t last_axis = status.last_axis;
  268|  13.2k|    const uint32_t stack_pos = status.stack_pos;
  269|  13.2k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  13.2k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  13.2k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 13.2k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  13.2k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  13.2k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 13.2k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  13.2k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  13.2k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 529, False: 12.7k]
  ------------------
  285|  50.3k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 49.7k, False: 529]
  ------------------
  286|  49.7k|        *oit = old_base;
  287|  49.7k|        ++oit;
  288|  49.7k|        ++num_decoded_points_;
  289|  49.7k|      }
  290|    529|      continue;
  291|    529|    }
  292|       |
  293|  12.7k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  12.7k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 97, False: 12.6k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     97|      axes_[0] = axis;
  300|    301|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 204, False: 97]
  ------------------
  301|    204|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    204|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 22, False: 182]
  |  |  ------------------
  ------------------
  302|    204|      }
  303|    259|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 166, False: 93]
  ------------------
  304|    641|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 479, False: 162]
  ------------------
  305|    479|          p_[axes_[j]] = 0;
  306|    479|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    479|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 219, False: 260]
  ------------------
  308|    219|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 4, False: 215]
  ------------------
  309|    219|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      4|              return false;
  311|      4|            }
  312|    219|          }
  313|    475|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    475|        }
  315|    162|        *oit = p_;
  316|    162|        ++oit;
  317|    162|        ++num_decoded_points_;
  318|    162|      }
  319|     93|      continue;
  320|     97|    }
  321|       |
  322|  12.6k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 12.6k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  12.6k|    const int num_remaining_bits = bit_length_ - level;
  327|  12.6k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  12.6k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  12.6k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  12.6k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  12.6k|    uint32_t number = 0;
  334|  12.6k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  12.6k|    uint32_t first_half = num_remaining_points / 2;
  337|  12.6k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 18, False: 12.6k]
  ------------------
  338|       |      // Invalid |number|.
  339|     18|      return false;
  340|     18|    }
  341|  12.6k|    first_half -= number;
  342|  12.6k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  12.6k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 12.2k, False: 382]
  ------------------
  345|  12.2k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 10.6k, False: 1.64k]
  ------------------
  346|  10.6k|        std::swap(first_half, second_half);
  347|  10.6k|      }
  348|  12.2k|    }
  349|       |
  350|  12.6k|    levels_stack_[stack_pos][axis] += 1;
  351|  12.6k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  12.6k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 11.1k, False: 1.51k]
  ------------------
  353|  11.1k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  11.1k|    }
  355|  12.6k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.26k, False: 10.3k]
  ------------------
  356|  2.26k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.26k|    }
  358|  12.6k|  }
  359|      6|  return true;
  360|     28|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  4.22M|        : num_remaining_points(num_remaining_points_),
  135|  4.22M|          last_axis(last_axis_),
  136|  4.22M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.22M|    uint32_t last_axis) {
  232|  4.22M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.22M, Folded]
  ------------------
  233|  4.22M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.22M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.20M, False: 3.02M]
  |  |  ------------------
  ------------------
  234|  4.22M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.22M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  2.12M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.12M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.12M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     25|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    222|      : bit_length_(0),
   87|    222|        num_points_(0),
   88|    222|        num_decoded_points_(0),
   89|    222|        dimension_(dimension),
   90|    222|        p_(dimension, 0),
   91|    222|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    222|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    222|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    179|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    179|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 176]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    176|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 13, False: 163]
  ------------------
  190|     13|    return false;
  191|     13|  }
  192|    163|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 161]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    161|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 21, False: 140]
  ------------------
  196|     21|    return true;
  197|     21|  }
  198|    140|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 21, False: 119]
  ------------------
  199|     21|    return false;
  200|     21|  }
  201|    119|  num_decoded_points_ = 0;
  202|       |
  203|    119|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 16, False: 103]
  ------------------
  204|     16|    return false;
  205|     16|  }
  206|    103|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 102]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|    102|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 5, False: 97]
  ------------------
  210|      5|    return false;
  211|      5|  }
  212|     97|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 94]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     94|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 34, False: 60]
  ------------------
  217|     34|    return false;
  218|     34|  }
  219|       |
  220|     60|  numbers_decoder_.EndDecoding();
  221|     60|  remaining_bits_decoder_.EndDecoding();
  222|     60|  axis_decoder_.EndDecoding();
  223|     60|  half_decoder_.EndDecoding();
  224|       |
  225|     60|  return true;
  226|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     94|    uint32_t num_points, OutputIteratorT &oit) {
  254|     94|  typedef DecodingStatus Status;
  255|     94|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     94|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     94|  DecodingStatus init_status(num_points, 0, 0);
  258|     94|  std::stack<Status> status_stack;
  259|     94|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.39M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.39M, False: 60]
  ------------------
  263|  2.39M|    const DecodingStatus status = status_stack.top();
  264|  2.39M|    status_stack.pop();
  265|       |
  266|  2.39M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.39M|    const uint32_t last_axis = status.last_axis;
  268|  2.39M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.39M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.39M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.39M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.39M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.39M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.39M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.39M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.39M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.39M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.07M, False: 1.31M]
  ------------------
  285|  90.8M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 89.8M, False: 1.07M]
  ------------------
  286|  89.8M|        *oit = old_base;
  287|  89.8M|        ++oit;
  288|  89.8M|        ++num_decoded_points_;
  289|  89.8M|      }
  290|  1.07M|      continue;
  291|  1.07M|    }
  292|       |
  293|  1.31M|    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.31M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 79.8k, False: 1.23M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  79.8k|      axes_[0] = axis;
  300|   119k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 39.8k, False: 79.8k]
  ------------------
  301|  39.8k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  39.8k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 12.1k, False: 27.6k]
  |  |  ------------------
  ------------------
  302|  39.8k|      }
  303|   206k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 126k, False: 79.7k]
  ------------------
  304|   307k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 180k, False: 126k]
  ------------------
  305|   180k|          p_[axes_[j]] = 0;
  306|   180k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   180k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 157k, False: 23.2k]
  ------------------
  308|   157k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 31, False: 157k]
  ------------------
  309|   157k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     31|              return false;
  311|     31|            }
  312|   157k|          }
  313|   180k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   180k|        }
  315|   126k|        *oit = p_;
  316|   126k|        ++oit;
  317|   126k|        ++num_decoded_points_;
  318|   126k|      }
  319|  79.7k|      continue;
  320|  79.8k|    }
  321|       |
  322|  1.23M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.23M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.23M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.23M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.23M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.23M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.23M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.23M|    uint32_t number = 0;
  334|  1.23M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.23M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.23M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 3, False: 1.23M]
  ------------------
  338|       |      // Invalid |number|.
  339|      3|      return false;
  340|      3|    }
  341|  1.23M|    first_half -= number;
  342|  1.23M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.23M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.17M, False: 66.4k]
  ------------------
  345|  1.17M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.12M, False: 44.5k]
  ------------------
  346|  1.12M|        std::swap(first_half, second_half);
  347|  1.12M|      }
  348|  1.17M|    }
  349|       |
  350|  1.23M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.23M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.23M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.21M, False: 19.3k]
  ------------------
  353|  1.21M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.21M|    }
  355|  1.23M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.17M, False: 65.3k]
  ------------------
  356|  1.17M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.17M|    }
  358|  1.23M|  }
  359|     60|  return true;
  360|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  2.39M|        : num_remaining_points(num_remaining_points_),
  135|  2.39M|          last_axis(last_axis_),
  136|  2.39M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.23M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.23M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.23M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     81|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    213|      : bit_length_(0),
   87|    213|        num_points_(0),
   88|    213|        num_decoded_points_(0),
   89|    213|        dimension_(dimension),
   90|    213|        p_(dimension, 0),
   91|    213|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    213|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    213|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    182|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    182|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 180]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|    180|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 174]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|    174|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 173]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    173|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 4, False: 169]
  ------------------
  196|      4|    return true;
  197|      4|  }
  198|    169|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 21, False: 148]
  ------------------
  199|     21|    return false;
  200|     21|  }
  201|    148|  num_decoded_points_ = 0;
  202|       |
  203|    148|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 22, False: 126]
  ------------------
  204|     22|    return false;
  205|     22|  }
  206|    126|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 125]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|    125|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 121]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|    121|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 120]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|    120|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 81, False: 39]
  ------------------
  217|     81|    return false;
  218|     81|  }
  219|       |
  220|     39|  numbers_decoder_.EndDecoding();
  221|     39|  remaining_bits_decoder_.EndDecoding();
  222|     39|  axis_decoder_.EndDecoding();
  223|     39|  half_decoder_.EndDecoding();
  224|       |
  225|     39|  return true;
  226|    120|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|    120|    uint32_t num_points, OutputIteratorT &oit) {
  254|    120|  typedef DecodingStatus Status;
  255|    120|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|    120|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|    120|  DecodingStatus init_status(num_points, 0, 0);
  258|    120|  std::stack<Status> status_stack;
  259|    120|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.22M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.22M, False: 39]
  ------------------
  263|  3.22M|    const DecodingStatus status = status_stack.top();
  264|  3.22M|    status_stack.pop();
  265|       |
  266|  3.22M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.22M|    const uint32_t last_axis = status.last_axis;
  268|  3.22M|    const uint32_t stack_pos = status.stack_pos;
  269|  3.22M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.22M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.22M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.22M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.22M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.22M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.22M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.22M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.22M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.43M, False: 1.78M]
  ------------------
  285|   170M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 169M, False: 1.43M]
  ------------------
  286|   169M|        *oit = old_base;
  287|   169M|        ++oit;
  288|   169M|        ++num_decoded_points_;
  289|   169M|      }
  290|  1.43M|      continue;
  291|  1.43M|    }
  292|       |
  293|  1.78M|    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.78M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 115k, False: 1.67M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|   115k|      axes_[0] = axis;
  300|   303k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 188k, False: 115k]
  ------------------
  301|   188k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   188k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 17.4k, False: 170k]
  |  |  ------------------
  ------------------
  302|   188k|      }
  303|   278k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 163k, False: 115k]
  ------------------
  304|   643k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 479k, False: 163k]
  ------------------
  305|   479k|          p_[axes_[j]] = 0;
  306|   479k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   479k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 205k, False: 274k]
  ------------------
  308|   205k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 80, False: 205k]
  ------------------
  309|   205k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     80|              return false;
  311|     80|            }
  312|   205k|          }
  313|   479k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   479k|        }
  315|   163k|        *oit = p_;
  316|   163k|        ++oit;
  317|   163k|        ++num_decoded_points_;
  318|   163k|      }
  319|   115k|      continue;
  320|   115k|    }
  321|       |
  322|  1.67M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.67M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.67M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.67M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.67M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.67M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.67M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.67M|    uint32_t number = 0;
  334|  1.67M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.67M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.67M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.67M]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.67M|    first_half -= number;
  342|  1.67M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.67M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.64M, False: 27.5k]
  ------------------
  345|  1.64M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.58M, False: 60.3k]
  ------------------
  346|  1.58M|        std::swap(first_half, second_half);
  347|  1.58M|      }
  348|  1.64M|    }
  349|       |
  350|  1.67M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.67M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.67M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.65M, False: 18.9k]
  ------------------
  353|  1.65M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.65M|    }
  355|  1.67M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.57M, False: 98.0k]
  ------------------
  356|  1.57M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.57M|    }
  358|  1.67M|  }
  359|     39|  return true;
  360|    120|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  3.22M|        : num_remaining_points(num_remaining_points_),
  135|  3.22M|          last_axis(last_axis_),
  136|  3.22M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.22M|    uint32_t last_axis) {
  232|  3.22M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 3.22M, Folded]
  ------------------
  233|  3.22M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.22M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.24M, False: 1.97M]
  |  |  ------------------
  ------------------
  234|  3.22M|  }
  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.22M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.67M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.67M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.67M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     43|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    169|      : bit_length_(0),
   87|    169|        num_points_(0),
   88|    169|        num_decoded_points_(0),
   89|    169|        dimension_(dimension),
   90|    169|        p_(dimension, 0),
   91|    169|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    169|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    169|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    150|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    150|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 146]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    146|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 136]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|    136|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 135]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    135|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 40, False: 95]
  ------------------
  196|     40|    return true;
  197|     40|  }
  198|     95|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 17, False: 78]
  ------------------
  199|     17|    return false;
  200|     17|  }
  201|     78|  num_decoded_points_ = 0;
  202|       |
  203|     78|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 30, False: 48]
  ------------------
  204|     30|    return false;
  205|     30|  }
  206|     48|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 47]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     47|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 46]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     46|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 44]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     44|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 24, False: 20]
  ------------------
  217|     24|    return false;
  218|     24|  }
  219|       |
  220|     20|  numbers_decoder_.EndDecoding();
  221|     20|  remaining_bits_decoder_.EndDecoding();
  222|     20|  axis_decoder_.EndDecoding();
  223|     20|  half_decoder_.EndDecoding();
  224|       |
  225|     20|  return true;
  226|     44|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     44|    uint32_t num_points, OutputIteratorT &oit) {
  254|     44|  typedef DecodingStatus Status;
  255|     44|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     44|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     44|  DecodingStatus init_status(num_points, 0, 0);
  258|     44|  std::stack<Status> status_stack;
  259|     44|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   153k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 153k, False: 20]
  ------------------
  263|   153k|    const DecodingStatus status = status_stack.top();
  264|   153k|    status_stack.pop();
  265|       |
  266|   153k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   153k|    const uint32_t last_axis = status.last_axis;
  268|   153k|    const uint32_t stack_pos = status.stack_pos;
  269|   153k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   153k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   153k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 153k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   153k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   153k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 7, False: 153k]
  ------------------
  278|      7|      return false;
  279|      7|    }
  280|       |
  281|   153k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   153k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 91, False: 152k]
  ------------------
  285|  3.24M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 3.24M, False: 91]
  ------------------
  286|  3.24M|        *oit = old_base;
  287|  3.24M|        ++oit;
  288|  3.24M|        ++num_decoded_points_;
  289|  3.24M|      }
  290|     91|      continue;
  291|     91|    }
  292|       |
  293|   152k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   152k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 115, False: 152k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    115|      axes_[0] = axis;
  300|  8.18k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 8.06k, False: 115]
  ------------------
  301|  8.06k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  8.06k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 100, False: 7.96k]
  |  |  ------------------
  ------------------
  302|  8.06k|      }
  303|    257|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 153, False: 104]
  ------------------
  304|  9.24k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 9.09k, False: 142]
  ------------------
  305|  9.09k|          p_[axes_[j]] = 0;
  306|  9.09k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  9.09k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 8.92k, False: 170]
  ------------------
  308|  8.92k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 11, False: 8.91k]
  ------------------
  309|  8.92k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     11|              return false;
  311|     11|            }
  312|  8.92k|          }
  313|  9.08k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  9.08k|        }
  315|    142|        *oit = p_;
  316|    142|        ++oit;
  317|    142|        ++num_decoded_points_;
  318|    142|      }
  319|    104|      continue;
  320|    115|    }
  321|       |
  322|   152k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 152k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   152k|    const int num_remaining_bits = bit_length_ - level;
  327|   152k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   152k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   152k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   152k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   152k|    uint32_t number = 0;
  334|   152k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   152k|    uint32_t first_half = num_remaining_points / 2;
  337|   152k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 6, False: 152k]
  ------------------
  338|       |      // Invalid |number|.
  339|      6|      return false;
  340|      6|    }
  341|   152k|    first_half -= number;
  342|   152k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   152k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 152k, False: 9]
  ------------------
  345|   152k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 129k, False: 23.0k]
  ------------------
  346|   129k|        std::swap(first_half, second_half);
  347|   129k|      }
  348|   152k|    }
  349|       |
  350|   152k|    levels_stack_[stack_pos][axis] += 1;
  351|   152k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   152k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 129k, False: 22.9k]
  ------------------
  353|   129k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   129k|    }
  355|   152k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 23.1k, False: 129k]
  ------------------
  356|  23.1k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  23.1k|    }
  358|   152k|  }
  359|     20|  return true;
  360|     44|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   153k|        : num_remaining_points(num_remaining_points_),
  135|   153k|          last_axis(last_axis_),
  136|   153k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   152k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   152k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   152k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     60|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  6.13M|    uint32_t last_axis) {
  232|  6.13M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 6.13M, Folded]
  ------------------
  233|  6.13M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  6.13M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 5.49M, False: 635k]
  |  |  ------------------
  ------------------
  234|  6.13M|  }
  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|  6.13M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  36.2k|    uint32_t last_axis) {
  232|  36.2k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 36.2k, Folded]
  ------------------
  233|  36.2k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  36.2k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 5.38k, False: 30.8k]
  |  |  ------------------
  ------------------
  234|  36.2k|  }
  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|  36.2k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.39M|    uint32_t last_axis) {
  232|  2.39M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.39M, Folded]
  ------------------
  233|  2.39M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.39M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.17M, False: 211k]
  |  |  ------------------
  ------------------
  234|  2.39M|  }
  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.39M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   153k|    uint32_t last_axis) {
  232|   153k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 153k]
  ------------------
  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|   153k|  uint32_t best_axis = 0;
  237|   153k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 152k, False: 95]
  ------------------
  238|  23.0M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 22.9M, False: 152k]
  ------------------
  239|  22.9M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 151k, False: 22.7M]
  ------------------
  240|   151k|        best_axis = axis;
  241|   151k|      }
  242|  22.9M|    }
  243|   152k|  } else {
  244|     95|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|     95|  }
  246|       |
  247|   153k|  return best_axis;
  248|   153k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    118|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    118|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    118|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    118|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    118|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 5, False: 113]
  ------------------
  187|      5|    return false;
  188|      5|  }
  189|    113|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 103]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|    103|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 102]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    102|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 100]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|    100|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 100]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|    100|  num_decoded_points_ = 0;
  202|       |
  203|    100|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 32, False: 68]
  ------------------
  204|     32|    return false;
  205|     32|  }
  206|     68|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 64]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     64|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 62]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     62|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 61]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     61|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 45, False: 16]
  ------------------
  217|     45|    return false;
  218|     45|  }
  219|       |
  220|     16|  numbers_decoder_.EndDecoding();
  221|     16|  remaining_bits_decoder_.EndDecoding();
  222|     16|  axis_decoder_.EndDecoding();
  223|     16|  half_decoder_.EndDecoding();
  224|       |
  225|     16|  return true;
  226|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     61|    uint32_t num_points, OutputIteratorT &oit) {
  254|     61|  typedef DecodingStatus Status;
  255|     61|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     61|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     61|  DecodingStatus init_status(num_points, 0, 0);
  258|     61|  std::stack<Status> status_stack;
  259|     61|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   863k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 863k, False: 16]
  ------------------
  263|   863k|    const DecodingStatus status = status_stack.top();
  264|   863k|    status_stack.pop();
  265|       |
  266|   863k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   863k|    const uint32_t last_axis = status.last_axis;
  268|   863k|    const uint32_t stack_pos = status.stack_pos;
  269|   863k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   863k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   863k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 863k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   863k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   863k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 863k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   863k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   863k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 430k, False: 433k]
  ------------------
  285|  61.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 61.3M, False: 430k]
  ------------------
  286|  61.3M|        *oit = old_base;
  287|  61.3M|        ++oit;
  288|  61.3M|        ++num_decoded_points_;
  289|  61.3M|      }
  290|   430k|      continue;
  291|   430k|    }
  292|       |
  293|   433k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   433k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 825, False: 432k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    825|      axes_[0] = axis;
  300|  2.47k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.65k, False: 825]
  ------------------
  301|  1.65k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.65k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 298, False: 1.35k]
  |  |  ------------------
  ------------------
  302|  1.65k|      }
  303|  2.21k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.41k, False: 795]
  ------------------
  304|  5.59k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.20k, False: 1.38k]
  ------------------
  305|  4.20k|          p_[axes_[j]] = 0;
  306|  4.20k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.20k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.22k, False: 1.97k]
  ------------------
  308|  2.22k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 30, False: 2.19k]
  ------------------
  309|  2.22k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     30|              return false;
  311|     30|            }
  312|  2.22k|          }
  313|  4.17k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.17k|        }
  315|  1.38k|        *oit = p_;
  316|  1.38k|        ++oit;
  317|  1.38k|        ++num_decoded_points_;
  318|  1.38k|      }
  319|    795|      continue;
  320|    825|    }
  321|       |
  322|   432k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 432k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   432k|    const int num_remaining_bits = bit_length_ - level;
  327|   432k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   432k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   432k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   432k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   432k|    uint32_t number = 0;
  334|   432k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   432k|    uint32_t first_half = num_remaining_points / 2;
  337|   432k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 15, False: 432k]
  ------------------
  338|       |      // Invalid |number|.
  339|     15|      return false;
  340|     15|    }
  341|   432k|    first_half -= number;
  342|   432k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   432k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 167k, False: 264k]
  ------------------
  345|   167k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 166k, False: 1.02k]
  ------------------
  346|   166k|        std::swap(first_half, second_half);
  347|   166k|      }
  348|   167k|    }
  349|       |
  350|   432k|    levels_stack_[stack_pos][axis] += 1;
  351|   432k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   432k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 432k, False: 42]
  ------------------
  353|   432k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   432k|    }
  355|   432k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 432k, False: 87]
  ------------------
  356|   432k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   432k|    }
  358|   432k|  }
  359|     16|  return true;
  360|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     94|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     94|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     94|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     94|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 93]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     93|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 86]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|     86|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 85]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     85|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 84]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     84|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 84]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     84|  num_decoded_points_ = 0;
  202|       |
  203|     84|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 18, False: 66]
  ------------------
  204|     18|    return false;
  205|     18|  }
  206|     66|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 6, False: 60]
  ------------------
  207|      6|    return false;
  208|      6|  }
  209|     60|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 58]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     58|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 56]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     56|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 41, False: 15]
  ------------------
  217|     41|    return false;
  218|     41|  }
  219|       |
  220|     15|  numbers_decoder_.EndDecoding();
  221|     15|  remaining_bits_decoder_.EndDecoding();
  222|     15|  axis_decoder_.EndDecoding();
  223|     15|  half_decoder_.EndDecoding();
  224|       |
  225|     15|  return true;
  226|     56|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     56|    uint32_t num_points, OutputIteratorT &oit) {
  254|     56|  typedef DecodingStatus Status;
  255|     56|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     56|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     56|  DecodingStatus init_status(num_points, 0, 0);
  258|     56|  std::stack<Status> status_stack;
  259|     56|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.41M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.41M, False: 15]
  ------------------
  263|  2.41M|    const DecodingStatus status = status_stack.top();
  264|  2.41M|    status_stack.pop();
  265|       |
  266|  2.41M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.41M|    const uint32_t last_axis = status.last_axis;
  268|  2.41M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.41M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.41M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.41M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.41M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.41M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.41M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.41M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.41M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.41M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.20M, False: 1.21M]
  ------------------
  285|  41.6M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 40.4M, False: 1.20M]
  ------------------
  286|  40.4M|        *oit = old_base;
  287|  40.4M|        ++oit;
  288|  40.4M|        ++num_decoded_points_;
  289|  40.4M|      }
  290|  1.20M|      continue;
  291|  1.20M|    }
  292|       |
  293|  1.21M|    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.21M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 926, False: 1.20M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    926|      axes_[0] = axis;
  300|  2.77k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.85k, False: 926]
  ------------------
  301|  1.85k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.85k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 341, False: 1.51k]
  |  |  ------------------
  ------------------
  302|  1.85k|      }
  303|  2.42k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.52k, False: 897]
  ------------------
  304|  6.04k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.54k, False: 1.50k]
  ------------------
  305|  4.54k|          p_[axes_[j]] = 0;
  306|  4.54k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.54k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.47k, False: 2.07k]
  ------------------
  308|  2.47k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 29, False: 2.44k]
  ------------------
  309|  2.47k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     29|              return false;
  311|     29|            }
  312|  2.47k|          }
  313|  4.51k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.51k|        }
  315|  1.50k|        *oit = p_;
  316|  1.50k|        ++oit;
  317|  1.50k|        ++num_decoded_points_;
  318|  1.50k|      }
  319|    897|      continue;
  320|    926|    }
  321|       |
  322|  1.20M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.20M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.20M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.20M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.20M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.20M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.20M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.20M|    uint32_t number = 0;
  334|  1.20M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.20M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.20M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 12, False: 1.20M]
  ------------------
  338|       |      // Invalid |number|.
  339|     12|      return false;
  340|     12|    }
  341|  1.20M|    first_half -= number;
  342|  1.20M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.20M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 656k, False: 553k]
  ------------------
  345|   656k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 655k, False: 651]
  ------------------
  346|   655k|        std::swap(first_half, second_half);
  347|   655k|      }
  348|   656k|    }
  349|       |
  350|  1.20M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.20M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.20M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.20M, False: 28]
  ------------------
  353|  1.20M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.20M|    }
  355|  1.20M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.20M, False: 48]
  ------------------
  356|  1.20M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.20M|    }
  358|  1.20M|  }
  359|     15|  return true;
  360|     56|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     92|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     92|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     92|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     92|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     92|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 91]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     91|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 86]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     86|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 85]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     85|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 84]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     84|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 84]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     84|  num_decoded_points_ = 0;
  202|       |
  203|     84|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 20, False: 64]
  ------------------
  204|     20|    return false;
  205|     20|  }
  206|     64|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 61]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     61|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 60]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     60|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 58]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     58|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 55, False: 3]
  ------------------
  217|     55|    return false;
  218|     55|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     58|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  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|  17.4k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 17.4k, False: 3]
  ------------------
  263|  17.4k|    const DecodingStatus status = status_stack.top();
  264|  17.4k|    status_stack.pop();
  265|       |
  266|  17.4k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  17.4k|    const uint32_t last_axis = status.last_axis;
  268|  17.4k|    const uint32_t stack_pos = status.stack_pos;
  269|  17.4k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  17.4k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  17.4k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 17.4k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  17.4k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  17.4k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 17.4k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  17.4k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  17.4k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 7.63k, False: 9.77k]
  ------------------
  285|  1.63M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.62M, False: 7.63k]
  ------------------
  286|  1.62M|        *oit = old_base;
  287|  1.62M|        ++oit;
  288|  1.62M|        ++num_decoded_points_;
  289|  1.62M|      }
  290|  7.63k|      continue;
  291|  7.63k|    }
  292|       |
  293|  9.77k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  9.77k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 607, False: 9.17k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    607|      axes_[0] = axis;
  300|  1.82k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.21k, False: 607]
  ------------------
  301|  1.21k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.21k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 257, False: 957]
  |  |  ------------------
  ------------------
  302|  1.21k|      }
  303|  1.62k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.02k, False: 593]
  ------------------
  304|  4.07k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.05k, False: 1.01k]
  ------------------
  305|  3.05k|          p_[axes_[j]] = 0;
  306|  3.05k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.05k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.82k, False: 1.23k]
  ------------------
  308|  1.82k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 14, False: 1.81k]
  ------------------
  309|  1.82k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     14|              return false;
  311|     14|            }
  312|  1.82k|          }
  313|  3.04k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.04k|        }
  315|  1.01k|        *oit = p_;
  316|  1.01k|        ++oit;
  317|  1.01k|        ++num_decoded_points_;
  318|  1.01k|      }
  319|    593|      continue;
  320|    607|    }
  321|       |
  322|  9.17k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 9.17k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  9.17k|    const int num_remaining_bits = bit_length_ - level;
  327|  9.17k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  9.17k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  9.17k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  9.17k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  9.17k|    uint32_t number = 0;
  334|  9.17k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  9.17k|    uint32_t first_half = num_remaining_points / 2;
  337|  9.17k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 41, False: 9.12k]
  ------------------
  338|       |      // Invalid |number|.
  339|     41|      return false;
  340|     41|    }
  341|  9.12k|    first_half -= number;
  342|  9.12k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  9.12k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 4.81k, False: 4.31k]
  ------------------
  345|  4.81k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 3.13k, False: 1.68k]
  ------------------
  346|  3.13k|        std::swap(first_half, second_half);
  347|  3.13k|      }
  348|  4.81k|    }
  349|       |
  350|  9.12k|    levels_stack_[stack_pos][axis] += 1;
  351|  9.12k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  9.12k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 9.03k, False: 90]
  ------------------
  353|  9.03k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  9.03k|    }
  355|  9.12k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 9.01k, False: 113]
  ------------------
  356|  9.01k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  9.01k|    }
  358|  9.12k|  }
  359|      3|  return true;
  360|     58|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    118|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    118|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    118|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    118|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    118|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 117]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    117|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 15, False: 102]
  ------------------
  190|     15|    return false;
  191|     15|  }
  192|    102|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 100]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    100|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 99]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     99|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 99]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     99|  num_decoded_points_ = 0;
  202|       |
  203|     99|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 37, False: 62]
  ------------------
  204|     37|    return false;
  205|     37|  }
  206|     62|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 61]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     61|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 59]
  ------------------
  210|      2|    return false;
  211|      2|  }
  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: 55, False: 3]
  ------------------
  217|     55|    return false;
  218|     55|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     58|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  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|  4.21M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.21M, False: 3]
  ------------------
  263|  4.21M|    const DecodingStatus status = status_stack.top();
  264|  4.21M|    status_stack.pop();
  265|       |
  266|  4.21M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.21M|    const uint32_t last_axis = status.last_axis;
  268|  4.21M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.21M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.21M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.21M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.21M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.21M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.21M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.21M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.21M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.21M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.10M, False: 2.10M]
  ------------------
  285|  14.4M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 12.3M, False: 2.10M]
  ------------------
  286|  12.3M|        *oit = old_base;
  287|  12.3M|        ++oit;
  288|  12.3M|        ++num_decoded_points_;
  289|  12.3M|      }
  290|  2.10M|      continue;
  291|  2.10M|    }
  292|       |
  293|  2.10M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  2.10M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 692, False: 2.10M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    692|      axes_[0] = axis;
  300|  2.07k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.38k, False: 692]
  ------------------
  301|  1.38k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.38k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 435, False: 949]
  |  |  ------------------
  ------------------
  302|  1.38k|      }
  303|  1.87k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.19k, False: 676]
  ------------------
  304|  4.75k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.57k, False: 1.18k]
  ------------------
  305|  3.57k|          p_[axes_[j]] = 0;
  306|  3.57k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.57k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.90k, False: 668]
  ------------------
  308|  2.90k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 16, False: 2.89k]
  ------------------
  309|  2.90k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     16|              return false;
  311|     16|            }
  312|  2.90k|          }
  313|  3.56k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.56k|        }
  315|  1.18k|        *oit = p_;
  316|  1.18k|        ++oit;
  317|  1.18k|        ++num_decoded_points_;
  318|  1.18k|      }
  319|    676|      continue;
  320|    692|    }
  321|       |
  322|  2.10M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.10M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.10M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.10M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.10M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.10M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.10M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.10M|    uint32_t number = 0;
  334|  2.10M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.10M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.10M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 39, False: 2.10M]
  ------------------
  338|       |      // Invalid |number|.
  339|     39|      return false;
  340|     39|    }
  341|  2.10M|    first_half -= number;
  342|  2.10M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.10M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 726k, False: 1.38M]
  ------------------
  345|   726k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 725k, False: 1.17k]
  ------------------
  346|   725k|        std::swap(first_half, second_half);
  347|   725k|      }
  348|   726k|    }
  349|       |
  350|  2.10M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.10M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.10M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.10M, False: 33]
  ------------------
  353|  2.10M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.10M|    }
  355|  2.10M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.10M, False: 61]
  ------------------
  356|  2.10M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.10M|    }
  358|  2.10M|  }
  359|      3|  return true;
  360|     58|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     43|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     43|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     43|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     43|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     43|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 41]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|     41|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 35]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|     35|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 35]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     35|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 3, False: 32]
  ------------------
  196|      3|    return true;
  197|      3|  }
  198|     32|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 32]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     32|  num_decoded_points_ = 0;
  202|       |
  203|     32|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 32, False: 0]
  ------------------
  204|     32|    return false;
  205|     32|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     31|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     31|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     31|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     31|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     31|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 30]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     30|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 22]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|     22|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 21]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     21|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 20]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     20|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 20]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     20|  num_decoded_points_ = 0;
  202|       |
  203|     20|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 20, False: 0]
  ------------------
  204|     20|    return false;
  205|     20|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     19|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     19|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     19|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     19|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 18]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     18|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 14]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|     14|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 13]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     13|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 12]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     12|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 12]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     12|  num_decoded_points_ = 0;
  202|       |
  203|     12|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 12, False: 0]
  ------------------
  204|     12|    return false;
  205|     12|  }
  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|    598|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    598|  qinfo_.quantization_bits = 0;
   67|    598|  qinfo_.range = 0;
   68|    598|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    559|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    559|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 1, False: 558]
  ------------------
   73|      1|    return false;
   74|      1|  }
   75|    558|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 5, False: 553]
  ------------------
   76|      5|    return false;
   77|      5|  }
   78|    553|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 1, False: 552]
  ------------------
   79|      1|    return false;
   80|      1|  }
   81|    552|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 1, False: 551]
  ------------------
   82|      1|    return false;
   83|      1|  }
   84|    551|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 35, False: 516]
  |  Branch (84:38): [True: 21, False: 14]
  ------------------
   85|     21|    return false;
   86|     21|  }
   87|    530|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 1, False: 529]
  ------------------
   88|      1|    return false;
   89|      1|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    529|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 12, False: 517]
  ------------------
   93|     12|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|     12|#define DRACO_LOGE printf
  ------------------
   94|     12|               compression_level_);
   95|     12|    return false;
   96|     12|  }
   97|       |
   98|    517|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    517|      std::back_inserter(*qpoints);
  100|    517|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    517|                           Converter>
  102|    517|      oit(oit_qpoints);
  103|    517|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 515, False: 2]
  ------------------
  104|    515|    qpoints->reserve(num_points_);
  105|    515|    switch (compression_level_) {
  106|    118|      case 0: {
  ------------------
  |  Branch (106:7): [True: 118, False: 397]
  ------------------
  107|    118|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|    118|        qpoints_decoder.DecodePoints(buffer, oit);
  109|    118|        break;
  110|      0|      }
  111|     94|      case 1: {
  ------------------
  |  Branch (111:7): [True: 94, False: 421]
  ------------------
  112|     94|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     94|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     94|        break;
  115|      0|      }
  116|     92|      case 2: {
  ------------------
  |  Branch (116:7): [True: 92, False: 423]
  ------------------
  117|     92|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     92|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     92|        break;
  120|      0|      }
  121|    118|      case 3: {
  ------------------
  |  Branch (121:7): [True: 118, False: 397]
  ------------------
  122|    118|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    118|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    118|        break;
  125|      0|      }
  126|     43|      case 4: {
  ------------------
  |  Branch (126:7): [True: 43, False: 472]
  ------------------
  127|     43|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     43|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     43|        break;
  130|      0|      }
  131|     31|      case 5: {
  ------------------
  |  Branch (131:7): [True: 31, False: 484]
  ------------------
  132|     31|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     31|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     31|        break;
  135|      0|      }
  136|     19|      case 6: {
  ------------------
  |  Branch (136:7): [True: 19, False: 496]
  ------------------
  137|     19|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     19|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     19|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 515]
  ------------------
  142|      0|        return false;
  143|    515|    }
  144|    515|  }
  145|       |
  146|    517|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 506, False: 11]
  ------------------
  147|    506|    return false;
  148|    506|  }
  149|     11|  return true;
  150|    517|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    517|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   115M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   115M|  const Self &operator=(const SourceType &source) {
   56|   115M|    *oit_ = Converter()(source);
   57|   115M|    return *this;
   58|   115M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   115M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   115M|    return Point3ui(v[0], v[1], v[2]);
   31|   115M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   115M|  const Self &operator++() {
   46|   115M|    ++oit_;
   47|   115M|    return *this;
   48|   115M|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  13.2M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  13.2M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 13.2M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  13.2M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  13.2M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  1.17G|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  1.17G|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 368, False: 1.17G]
  ------------------
   78|    368|      return false;  // Buffer overflow.
   79|    368|    }
   80|  1.17G|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  1.17G|    pos_ += size_to_decode;
   82|  1.17G|    return true;
   83|  1.17G|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  36.8k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  15.7k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  51.7k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   235k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  6.96k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  13.2M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.09M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  8.01k|    inline void reset(const void *b, size_t s) {
  131|  8.01k|      bit_offset_ = 0;
  132|  8.01k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  8.01k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  8.01k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  6.76k|    inline uint64_t BitsDecoded() const {
  138|  6.76k|      return static_cast<uint64_t>(bit_offset_);
  139|  6.76k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  13.2M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  13.2M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 13.2M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  13.2M|      uint32_t value = 0;
  165|  29.4M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 16.1M, False: 13.2M]
  ------------------
  166|  16.1M|        value |= GetBit() << bit;
  167|  16.1M|      }
  168|  13.2M|      *x = value;
  169|  13.2M|      return true;
  170|  13.2M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  16.1M|    inline int GetBit() {
  176|  16.1M|      const size_t off = bit_offset_;
  177|  16.1M|      const size_t byte_offset = off >> 3;
  178|  16.1M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  16.1M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 15.6M, False: 548k]
  ------------------
  180|  15.6M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  15.6M|        bit_offset_ = off + 1;
  182|  15.6M|        return bit;
  183|  15.6M|      }
  184|   548k|      return 0;
  185|  16.1M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  8.91M|  bool Decode(T *out_val) {
   69|  8.91M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 4.55k, False: 8.90M]
  ------------------
   70|  4.55k|      return false;
   71|  4.55k|    }
   72|  8.90M|    pos_ += sizeof(T);
   73|  8.90M|    return true;
   74|  8.91M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  8.91M|  bool Peek(T *out_val) {
   88|  8.91M|    const size_t size_to_decode = sizeof(T);
   89|  8.91M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 4.55k, False: 8.90M]
  ------------------
   90|  4.55k|      return false;  // Buffer overflow.
   91|  4.55k|    }
   92|  8.90M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  8.90M|    return true;
   94|  8.91M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  13.8k|  bool Decode(T *out_val) {
   69|  13.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 121, False: 13.6k]
  ------------------
   70|    121|      return false;
   71|    121|    }
   72|  13.6k|    pos_ += sizeof(T);
   73|  13.6k|    return true;
   74|  13.8k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  13.8k|  bool Peek(T *out_val) {
   88|  13.8k|    const size_t size_to_decode = sizeof(T);
   89|  13.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 121, False: 13.6k]
  ------------------
   90|    121|      return false;  // Buffer overflow.
   91|    121|    }
   92|  13.6k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  13.6k|    return true;
   94|  13.8k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   193k|  bool Decode(T *out_val) {
   69|   193k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 463, False: 192k]
  ------------------
   70|    463|      return false;
   71|    463|    }
   72|   192k|    pos_ += sizeof(T);
   73|   192k|    return true;
   74|   193k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   193k|  bool Peek(T *out_val) {
   88|   193k|    const size_t size_to_decode = sizeof(T);
   89|   193k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 463, False: 192k]
  ------------------
   90|    463|      return false;  // Buffer overflow.
   91|    463|    }
   92|   192k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   192k|    return true;
   94|   193k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  20.1k|  bool Decode(T *out_val) {
   69|  20.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 130, False: 19.9k]
  ------------------
   70|    130|      return false;
   71|    130|    }
   72|  19.9k|    pos_ += sizeof(T);
   73|  19.9k|    return true;
   74|  20.1k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  20.1k|  bool Peek(T *out_val) {
   88|  20.1k|    const size_t size_to_decode = sizeof(T);
   89|  20.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 130, False: 19.9k]
  ------------------
   90|    130|      return false;  // Buffer overflow.
   91|    130|    }
   92|  19.9k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  19.9k|    return true;
   94|  20.1k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   442k|  bool Decode(T *out_val) {
   69|   442k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 120, False: 442k]
  ------------------
   70|    120|      return false;
   71|    120|    }
   72|   442k|    pos_ += sizeof(T);
   73|   442k|    return true;
   74|   442k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   442k|  bool Peek(T *out_val) {
   88|   442k|    const size_t size_to_decode = sizeof(T);
   89|   442k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 120, False: 442k]
  ------------------
   90|    120|      return false;  // Buffer overflow.
   91|    120|    }
   92|   442k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   442k|    return true;
   94|   442k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  47.6k|  bool Decode(T *out_val) {
   69|  47.6k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 8, False: 47.6k]
  ------------------
   70|      8|      return false;
   71|      8|    }
   72|  47.6k|    pos_ += sizeof(T);
   73|  47.6k|    return true;
   74|  47.6k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  47.6k|  bool Peek(T *out_val) {
   88|  47.6k|    const size_t size_to_decode = sizeof(T);
   89|  47.6k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 8, False: 47.6k]
  ------------------
   90|      8|      return false;  // Buffer overflow.
   91|      8|    }
   92|  47.6k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  47.6k|    return true;
   94|  47.6k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.57k|  bool Decode(T *out_val) {
   69|  1.57k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 50, False: 1.52k]
  ------------------
   70|     50|      return false;
   71|     50|    }
   72|  1.52k|    pos_ += sizeof(T);
   73|  1.52k|    return true;
   74|  1.57k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.57k|  bool Peek(T *out_val) {
   88|  1.57k|    const size_t size_to_decode = sizeof(T);
   89|  1.57k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 50, False: 1.52k]
  ------------------
   90|     50|      return false;  // Buffer overflow.
   91|     50|    }
   92|  1.52k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.52k|    return true;
   94|  1.57k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    708|  bool Decode(T *out_val) {
   69|    708|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 8, False: 700]
  ------------------
   70|      8|      return false;
   71|      8|    }
   72|    700|    pos_ += sizeof(T);
   73|    700|    return true;
   74|    708|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    708|  bool Peek(T *out_val) {
   88|    708|    const size_t size_to_decode = sizeof(T);
   89|    708|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 8, False: 700]
  ------------------
   90|      8|      return false;  // Buffer overflow.
   91|      8|    }
   92|    700|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    700|    return true;
   94|    708|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   424M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   394M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  12.6M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  12.6M|    return value_ >= val;
  100|  12.6M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   255M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  3.04G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  28.7M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   119M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   119M|    value_ = i.value_;
  153|   119M|    return *this;
  154|   119M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|  1.23G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  1.23G|    value_ = i.value_;
  153|  1.23G|    return *this;
  154|  1.23G|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  28.7M|  inline ThisIndexType &operator++() {
  103|  28.7M|    ++value_;
  104|  28.7M|    return *this;
  105|  28.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.29G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.29G|    return value_ == i.value_;
   77|  2.29G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   832M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  4.27k|  constexpr bool operator<(const IndexType &i) const {
   88|  4.27k|    return value_ < i.value_;
   89|  4.27k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   125M|  constexpr bool operator==(const IndexType &i) const {
   76|   125M|    return value_ == i.value_;
   77|   125M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   221M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   221M|    return ThisIndexType(value_ - val);
  133|   221M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   617M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   617M|    return ThisIndexType(value_ + val);
  127|   617M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  25.2M|  constexpr bool operator==(const IndexType &i) const {
   76|  25.2M|    return value_ == i.value_;
   77|  25.2M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   205M|  constexpr bool operator!=(const IndexType &i) const {
   82|   205M|    return value_ != i.value_;
   83|   205M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   368M|  constexpr bool operator!=(const IndexType &i) const {
   82|   368M|    return value_ != i.value_;
   83|   368M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   487M|  inline ThisIndexType &operator++() {
  103|   487M|    ++value_;
  104|   487M|    return *this;
  105|   487M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   359M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   359M|    value_ = i.value_;
  153|   359M|    return *this;
  154|   359M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   899M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   899M|    value_ = i.value_;
  153|   899M|    return *this;
  154|   899M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  48.2M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  48.2M|    return value_ >= val;
  100|  48.2M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  12.8M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.01G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  19.6G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   187M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  15.1G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   190M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  10.4M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  10.4M|    return ThisIndexType(value_ + val);
  127|  10.4M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   138M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  38.2M|  constexpr bool operator<(const IndexType &i) const {
   88|  38.2M|    return value_ < i.value_;
   89|  38.2M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   534M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  1.23G|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  80.5M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   365M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   638M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  6.88M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  6.88M|    value_ = i.value_;
  153|  6.88M|    return *this;
  154|  6.88M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  12.8M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  12.8M|    value_ += val;
  141|  12.8M|    return *this;
  142|  12.8M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  37.9M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  37.9M|    value_ = val;
  157|  37.9M|    return *this;
  158|  37.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  1.19G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  8.18M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  8.17M|  inline ThisIndexType &operator++() {
  103|  8.17M|    ++value_;
  104|  8.17M|    return *this;
  105|  8.17M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  28.8M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|  20.3M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   304M|  inline ThisIndexType &operator++() {
  103|   304M|    ++value_;
  104|   304M|    return *this;
  105|   304M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|  20.3M|  inline ThisIndexType &operator++() {
  103|  20.3M|    ++value_;
  104|  20.3M|    return *this;
  105|  20.3M|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   275M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   275M|    return value_ >= val;
  100|   275M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  42.1M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  42.1M|    return vector_[index.value()];
   75|  42.1M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  28.8M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  11.7k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  18.8k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  77.0M|  inline reference operator[](const IndexTypeT &index) {
   71|  77.0M|    return vector_[index.value()];
   72|  77.0M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  1.26k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  25.3M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  4.11k|  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|  12.6M|  inline reference operator[](const IndexTypeT &index) {
   71|  12.6M|    return vector_[index.value()];
   72|  12.6M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  28.9M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  28.9M|    return vector_[index.value()];
   75|  28.9M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   154M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  14.8M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   325M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   325M|    return vector_[index.value()];
   75|   325M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   721M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   721M|    return vector_[index.value()];
   75|   721M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   313M|  inline reference operator[](const IndexTypeT &index) {
   71|   313M|    return vector_[index.value()];
   72|   313M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  53.0M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  53.0M|    return vector_[index.value()];
   75|  53.0M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   261M|  inline reference operator[](const IndexTypeT &index) {
   71|   261M|    return vector_[index.value()];
   72|   261M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  75.1M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   169M|  inline reference operator[](const IndexTypeT &index) {
   71|   169M|    return vector_[index.value()];
   72|   169M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.36k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   155M|  inline reference operator[](const IndexTypeT &index) {
   71|   155M|    return vector_[index.value()];
   72|   155M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  62.8k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.98M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  59.3k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  7.70k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  7.70k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  7.70k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  7.70k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  14.8k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  14.8k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  14.8k|    vector_.swap(arg.vector_);
   57|  14.8k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  14.8k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  14.8k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  14.8k|    vector_.swap(arg.vector_);
   57|  14.8k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  7.70k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  7.70k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  7.70k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  13.4k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  31.7k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  61.1k|int32_t DataTypeLength(DataType dt) {
   20|  61.1k|  switch (dt) {
   21|  20.8k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 20.8k, False: 40.3k]
  ------------------
   22|  25.3k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 4.55k, False: 56.6k]
  ------------------
   23|  25.3k|      return 1;
   24|  3.52k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 3.52k, False: 57.6k]
  ------------------
   25|  5.01k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 1.49k, False: 59.7k]
  ------------------
   26|  5.01k|      return 2;
   27|  25.1k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 25.1k, False: 36.0k]
  ------------------
   28|  26.5k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.39k, False: 59.8k]
  ------------------
   29|  26.5k|      return 4;
   30|    132|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 132, False: 61.0k]
  ------------------
   31|    517|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 385, False: 60.8k]
  ------------------
   32|    517|      return 8;
   33|  3.38k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.38k, False: 57.8k]
  ------------------
   34|  3.38k|      return 4;
   35|    118|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 118, False: 61.0k]
  ------------------
   36|    118|      return 8;
   37|    205|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 205, False: 60.9k]
  ------------------
   38|    205|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 61.1k]
  ------------------
   40|      0|      return -1;
   41|  61.1k|  }
   42|  61.1k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  2.39k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|     10|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  13.4k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|     10|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|     58|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  15.8k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  15.8k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|     58|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  14.5k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  15.8k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.33k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  2.40k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|     10|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  2.39k|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  13.4k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|     10|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  13.4k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   401k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   401k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 401k, Folded]
  ------------------
   65|   401k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.66k, False: 399k]
  ------------------
   66|  1.66k|      return false;
   67|  1.66k|    }
   68|   401k|  } 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|   399k|  return true;
   77|   401k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   143k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   143k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   143k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 84, False: 143k]
  ------------------
   33|     84|    return false;
   34|     84|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   143k|  uint8_t in;
   39|   143k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1.03k, False: 142k]
  ------------------
   40|  1.03k|    return false;
   41|  1.03k|  }
   42|   142k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 23.2k, False: 119k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  23.2k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 594, False: 22.6k]
  ------------------
   45|    594|      return false;
   46|    594|    }
   47|       |    // Append decoded info from this byte.
   48|  22.6k|    *out_val <<= 7;
   49|  22.6k|    *out_val |= in & ((1 << 7) - 1);
   50|   119k|  } else {
   51|       |    // Last byte reached
   52|   119k|    *out_val = in;
   53|   119k|  }
   54|   141k|  return true;
   55|   142k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  9.12k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  9.12k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  9.12k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 9.12k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  9.12k|  uint8_t in;
   39|  9.12k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 34, False: 9.09k]
  ------------------
   40|     34|    return false;
   41|     34|  }
   42|  9.09k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 622, False: 8.47k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    622|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 28, False: 594]
  ------------------
   45|     28|      return false;
   46|     28|    }
   47|       |    // Append decoded info from this byte.
   48|    594|    *out_val <<= 7;
   49|    594|    *out_val |= in & ((1 << 7) - 1);
   50|  8.47k|  } else {
   51|       |    // Last byte reached
   52|  8.47k|    *out_val = in;
   53|  8.47k|  }
   54|  9.06k|  return true;
   55|  9.09k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  7.98k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  7.98k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 7.98k, Folded]
  ------------------
   65|  7.98k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 165, False: 7.82k]
  ------------------
   66|    165|      return false;
   67|    165|    }
   68|  7.98k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  7.82k|  return true;
   77|  7.98k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.72k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.72k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.72k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 4.72k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.72k|  uint8_t in;
   39|  4.72k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 46, False: 4.68k]
  ------------------
   40|     46|    return false;
   41|     46|  }
   42|  4.68k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 391, False: 4.29k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    391|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 36, False: 355]
  ------------------
   45|     36|      return false;
   46|     36|    }
   47|       |    // Append decoded info from this byte.
   48|    355|    *out_val <<= 7;
   49|    355|    *out_val |= in & ((1 << 7) - 1);
   50|  4.29k|  } else {
   51|       |    // Last byte reached
   52|  4.29k|    *out_val = in;
   53|  4.29k|  }
   54|  4.64k|  return true;
   55|  4.68k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   203k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   203k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   203k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 18, False: 203k]
  ------------------
   33|     18|    return false;
   34|     18|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   203k|  uint8_t in;
   39|   203k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 175, False: 203k]
  ------------------
   40|    175|    return false;
   41|    175|  }
   42|   203k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.97k, False: 201k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.97k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 135, False: 1.83k]
  ------------------
   45|    135|      return false;
   46|    135|    }
   47|       |    // Append decoded info from this byte.
   48|  1.83k|    *out_val <<= 7;
   49|  1.83k|    *out_val |= in & ((1 << 7) - 1);
   50|   201k|  } else {
   51|       |    // Last byte reached
   52|   201k|    *out_val = in;
   53|   201k|  }
   54|   202k|  return true;
   55|   203k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  5.06k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  5.06k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 5.06k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  5.06k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  5.06k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  5.06k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 74, False: 4.99k]
  ------------------
   72|     74|      return false;
   73|     74|    }
   74|  4.99k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  4.99k|  }
   76|  4.99k|  return true;
   77|  5.06k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  5.63k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  5.63k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  5.63k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 22, False: 5.61k]
  ------------------
   33|     22|    return false;
   34|     22|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  5.61k|  uint8_t in;
   39|  5.61k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 52, False: 5.56k]
  ------------------
   40|     52|    return false;
   41|     52|  }
   42|  5.56k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 573, False: 4.99k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    573|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 126, False: 447]
  ------------------
   45|    126|      return false;
   46|    126|    }
   47|       |    // Append decoded info from this byte.
   48|    447|    *out_val <<= 7;
   49|    447|    *out_val |= in & ((1 << 7) - 1);
   50|  4.99k|  } else {
   51|       |    // Last byte reached
   52|  4.99k|    *out_val = in;
   53|  4.99k|  }
   54|  5.43k|  return true;
   55|  5.56k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.17k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.17k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.17k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 4.17k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.17k|  uint8_t in;
   39|  4.17k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 21, False: 4.14k]
  ------------------
   40|     21|    return false;
   41|     21|  }
   42|  4.14k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 829, False: 3.32k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    829|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 45, False: 784]
  ------------------
   45|     45|      return false;
   46|     45|    }
   47|       |    // Append decoded info from this byte.
   48|    784|    *out_val <<= 7;
   49|    784|    *out_val |= in & ((1 << 7) - 1);
   50|  3.32k|  } else {
   51|       |    // Last byte reached
   52|  3.32k|    *out_val = in;
   53|  3.32k|  }
   54|  4.10k|  return true;
   55|  4.14k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  29.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  29.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  29.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 29.1k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  29.1k|  uint8_t in;
   39|  29.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 51, False: 29.0k]
  ------------------
   40|     51|    return false;
   41|     51|  }
   42|  29.0k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 603, False: 28.4k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    603|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 44, False: 559]
  ------------------
   45|     44|      return false;
   46|     44|    }
   47|       |    // Append decoded info from this byte.
   48|    559|    *out_val <<= 7;
   49|    559|    *out_val |= in & ((1 << 7) - 1);
   50|  28.4k|  } else {
   51|       |    // Last byte reached
   52|  28.4k|    *out_val = in;
   53|  28.4k|  }
   54|  29.0k|  return true;
   55|  29.0k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  10.5k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  10.5k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  10.5k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 63, False: 10.4k]
  ------------------
   33|     63|    return false;
   34|     63|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  10.4k|  uint8_t in;
   39|  10.4k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 110, False: 10.3k]
  ------------------
   40|    110|    return false;
   41|    110|  }
   42|  10.3k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.55k, False: 7.78k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.55k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 354, False: 2.20k]
  ------------------
   45|    354|      return false;
   46|    354|    }
   47|       |    // Append decoded info from this byte.
   48|  2.20k|    *out_val <<= 7;
   49|  2.20k|    *out_val |= in & ((1 << 7) - 1);
   50|  7.78k|  } else {
   51|       |    // Last byte reached
   52|  7.78k|    *out_val = in;
   53|  7.78k|  }
   54|  9.98k|  return true;
   55|  10.3k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  8.61k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.61k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.61k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 41, False: 8.57k]
  ------------------
   33|     41|    return false;
   34|     41|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.57k|  uint8_t in;
   39|  8.57k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 77, False: 8.50k]
  ------------------
   40|     77|    return false;
   41|     77|  }
   42|  8.50k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 4.96k, False: 3.53k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  4.96k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 494, False: 4.47k]
  ------------------
   45|    494|      return false;
   46|    494|    }
   47|       |    // Append decoded info from this byte.
   48|  4.47k|    *out_val <<= 7;
   49|  4.47k|    *out_val |= in & ((1 << 7) - 1);
   50|  4.47k|  } else {
   51|       |    // Last byte reached
   52|  3.53k|    *out_val = in;
   53|  3.53k|  }
   54|  8.00k|  return true;
   55|  8.50k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  34.9k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  34.9k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  34.9k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 34.9k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  34.9k|  uint8_t in;
   39|  34.9k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 65, False: 34.9k]
  ------------------
   40|     65|    return false;
   41|     65|  }
   42|  34.9k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.13k, False: 31.7k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.13k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 47, False: 3.08k]
  ------------------
   45|     47|      return false;
   46|     47|    }
   47|       |    // Append decoded info from this byte.
   48|  3.08k|    *out_val <<= 7;
   49|  3.08k|    *out_val |= in & ((1 << 7) - 1);
   50|  31.7k|  } else {
   51|       |    // Last byte reached
   52|  31.7k|    *out_val = in;
   53|  31.7k|  }
   54|  34.8k|  return true;
   55|  34.9k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  67.1k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|  83.4k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  6.95k|  Self operator-(const Self &o) const {
  138|  6.95k|    Self ret;
  139|  27.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 20.8k, False: 6.95k]
  ------------------
  140|  20.8k|      ret[i] = (*this)[i] - o[i];
  141|  20.8k|    }
  142|  6.95k|    return ret;
  143|  6.95k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  17.1k|  VectorD() {
   41|  68.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 51.5k, False: 17.1k]
  ------------------
   42|  51.5k|      (*this)[i] = Scalar(0);
   43|  51.5k|    }
   44|  17.1k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|   724M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     41|      : v_({{c0, c1, c2}}) {
   60|     41|    DRACO_DCHECK_EQ(dimension, 3);
   61|     41|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   133M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  11.0M|  Self operator-(const Self &o) const {
  138|  11.0M|    Self ret;
  139|  44.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 33.2M, False: 11.0M]
  ------------------
  140|  33.2M|      ret[i] = (*this)[i] - o[i];
  141|  33.2M|    }
  142|  11.0M|    return ret;
  143|  11.0M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  5.51M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  5.51M|  static_assert(std::is_signed<ScalarT>::value,
  321|  5.51M|                "ScalarT must be a signed type. ");
  322|  5.51M|  VectorD<ScalarT, 3> r;
  323|  5.51M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  5.51M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  5.51M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  5.51M|  return r;
  327|  5.51M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  5.51M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  5.51M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.17M|  Scalar AbsSum() const {
  238|  2.17M|    Scalar result(0);
  239|  8.68M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 6.52M, False: 2.16M]
  ------------------
  240|  6.52M|      Scalar next_value = std::abs(v_[i]);
  241|  6.52M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 12.0k, False: 6.50M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  12.0k|        return std::numeric_limits<Scalar>::max();
  244|  12.0k|      }
  245|  6.50M|      result += next_value;
  246|  6.50M|    }
  247|  2.16M|    return result;
  248|  2.17M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   243k|  Self operator/(const Scalar &o) const {
  183|   243k|    Self ret;
  184|   975k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 731k, False: 243k]
  ------------------
  185|   731k|      ret[i] = (*this)[i] / o;
  186|   731k|    }
  187|   243k|    return ret;
  188|   243k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   167M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  9.53M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  6.52M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.58M|  Self operator-() const {
  121|  1.58M|    Self ret;
  122|  6.35M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 4.76M, False: 1.58M]
  ------------------
  123|  4.76M|      ret[i] = -(*this)[i];
  124|  4.76M|    }
  125|  1.58M|    return ret;
  126|  1.58M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  4.76M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  14.7M|  Self operator-(const Self &o) const {
  138|  14.7M|    Self ret;
  139|  44.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 29.4M, False: 14.7M]
  ------------------
  140|  29.4M|      ret[i] = (*this)[i] - o[i];
  141|  29.4M|    }
  142|  14.7M|    return ret;
  143|  14.7M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|   176M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|   264M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|   635M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  29.4M|  Self operator+(const Self &o) const {
  130|  29.4M|    Self ret;
  131|  88.2M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 58.8M, False: 29.4M]
  ------------------
  132|  58.8M|      ret[i] = (*this)[i] + o[i];
  133|  58.8M|    }
  134|  29.4M|    return ret;
  135|  29.4M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|   554M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  17.6M|  Self operator-(const Self &o) const {
  138|  17.6M|    Self ret;
  139|  52.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 35.2M, False: 17.6M]
  ------------------
  140|  35.2M|      ret[i] = (*this)[i] - o[i];
  141|  35.2M|    }
  142|  17.6M|    return ret;
  143|  17.6M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  17.6M|  Self operator+(const Self &o) const {
  130|  17.6M|    Self ret;
  131|  52.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 35.2M, False: 17.6M]
  ------------------
  132|  35.2M|      ret[i] = (*this)[i] + o[i];
  133|  35.2M|    }
  134|  17.6M|    return ret;
  135|  17.6M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   457k|  bool operator==(const Self &o) const {
  207|  1.36M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 912k, False: 454k]
  ------------------
  208|   912k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 3.28k, False: 909k]
  ------------------
  209|  3.28k|        return false;
  210|  3.28k|      }
  211|   912k|    }
  212|   454k|    return true;
  213|   457k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  5.49M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  3.66k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  4.05k|  Scalar Dot(const Self &o) const {
  251|  4.05k|    Scalar ret(0);
  252|  16.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 12.1k, False: 4.05k]
  ------------------
  253|  12.1k|      ret += (*this)[i] * o[i];
  254|  12.1k|    }
  255|  4.05k|    return ret;
  256|  4.05k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    384|  Self operator*(const Scalar &o) const {
  175|    384|    Self ret;
  176|  1.53k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.15k, False: 384]
  ------------------
  177|  1.15k|      ret[i] = (*this)[i] * o;
  178|  1.15k|    }
  179|    384|    return ret;
  180|    384|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  3.28k|  Self operator-(const Self &o) const {
  138|  3.28k|    Self ret;
  139|  9.85k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 6.56k, False: 3.28k]
  ------------------
  140|  6.56k|      ret[i] = (*this)[i] - o[i];
  141|  6.56k|    }
  142|  3.28k|    return ret;
  143|  3.28k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  6.56k|  VectorD() {
   41|  19.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 13.1k, False: 6.56k]
  ------------------
   42|  13.1k|      (*this)[i] = Scalar(0);
   43|  13.1k|    }
   44|  6.56k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   918k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   918k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   918k|    v_[0] = c0;
   55|   918k|    v_[1] = c1;
   56|   918k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  26.1k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   419k|  bool operator==(const Self &o) const {
  207|  1.18M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 802k, False: 381k]
  ------------------
  208|   802k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 37.8k, False: 764k]
  ------------------
  209|  37.8k|        return false;
  210|  37.8k|      }
  211|   802k|    }
  212|   381k|    return true;
  213|   419k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  2.42M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  32.3M|  VectorD() {
   41|   129M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 97.0M, False: 32.3M]
  ------------------
   42|  97.0M|      (*this)[i] = Scalar(0);
   43|  97.0M|    }
   44|  32.3M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  40.3k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  43.0k|  Scalar Dot(const Self &o) const {
  251|  43.0k|    Scalar ret(0);
  252|   172k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 129k, False: 43.0k]
  ------------------
  253|   129k|      ret += (*this)[i] * o[i];
  254|   129k|    }
  255|  43.0k|    return ret;
  256|  43.0k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.70k|  Self operator-(const Self &o) const {
  138|  2.70k|    Self ret;
  139|  8.10k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 5.40k, False: 2.70k]
  ------------------
  140|  5.40k|      ret[i] = (*this)[i] - o[i];
  141|  5.40k|    }
  142|  2.70k|    return ret;
  143|  2.70k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  10.3k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  30.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 20.6k, False: 10.3k]
  ------------------
  104|  20.6k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 20.6k, False: 0]
  ------------------
  105|  20.6k|        v_[i] = Scalar(src_vector[i]);
  106|  20.6k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  20.6k|    }
  110|  10.3k|  }
_ZNK5draco7VectorDImLi2EEmlERKm:
  174|  2.59k|  Self operator*(const Scalar &o) const {
  175|  2.59k|    Self ret;
  176|  7.78k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 5.19k, False: 2.59k]
  ------------------
  177|  5.19k|      ret[i] = (*this)[i] * o;
  178|  5.19k|    }
  179|  2.59k|    return ret;
  180|  2.59k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  10.3k|  VectorD() {
   41|  31.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 20.7k, False: 10.3k]
  ------------------
   42|  20.7k|      (*this)[i] = Scalar(0);
   43|  20.7k|    }
   44|  10.3k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  46.5k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  41.4k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  3.20k|  Self operator+(const Self &o) const {
  130|  3.20k|    Self ret;
  131|  9.60k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.40k, False: 3.20k]
  ------------------
  132|  6.40k|      ret[i] = (*this)[i] + o[i];
  133|  6.40k|    }
  134|  3.20k|    return ret;
  135|  3.20k|  }
_ZN5draco7VectorDImLi2EEC2ERKmS3_:
   52|  2.59k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  2.59k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  2.59k|    v_[0] = c0;
   55|  2.59k|    v_[1] = c1;
   56|  2.59k|  }
_ZNK5draco7VectorDImLi2EEmlERKS1_:
  145|  2.59k|  Self operator*(const Self &o) const {
  146|  2.59k|    Self ret;
  147|  7.78k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (147:21): [True: 5.19k, False: 2.59k]
  ------------------
  148|  5.19k|      ret[i] = (*this)[i] * o[i];
  149|  5.19k|    }
  150|  2.59k|    return ret;
  151|  2.59k|  }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  5.16k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  15.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 10.3k, False: 5.16k]
  ------------------
  104|  10.3k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 10.3k, False: 0]
  ------------------
  105|  10.3k|        v_[i] = Scalar(src_vector[i]);
  106|  10.3k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  10.3k|    }
  110|  5.16k|  }
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.57k|  Self operator+(const Self &o) const {
  130|  2.57k|    Self ret;
  131|  10.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 7.73k, False: 2.57k]
  ------------------
  132|  7.73k|      ret[i] = (*this)[i] + o[i];
  133|  7.73k|    }
  134|  2.57k|    return ret;
  135|  2.57k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.57k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.57k|  return v * o;
  294|  2.57k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.57k|  Self operator*(const Scalar &o) const {
  175|  2.57k|    Self ret;
  176|  10.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 7.73k, False: 2.57k]
  ------------------
  177|  7.73k|      ret[i] = (*this)[i] * o;
  178|  7.73k|    }
  179|  2.57k|    return ret;
  180|  2.57k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   841k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   841k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   841k|    v_[0] = c0;
   55|   841k|    v_[1] = c1;
   56|   841k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  2.57k|  Self operator*(const Scalar &o) const {
  175|  2.57k|    Self ret;
  176|  7.73k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 5.15k, False: 2.57k]
  ------------------
  177|  5.15k|      ret[i] = (*this)[i] * o;
  178|  5.15k|    }
  179|  2.57k|    return ret;
  180|  2.57k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  10.4k|  VectorD() {
   41|  31.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 20.8k, False: 10.4k]
  ------------------
   42|  20.8k|      (*this)[i] = Scalar(0);
   43|  20.8k|    }
   44|  10.4k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.56k|  Self operator/(const Scalar &o) const {
  183|  2.56k|    Self ret;
  184|  7.70k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 5.13k, False: 2.56k]
  ------------------
  185|  5.13k|      ret[i] = (*this)[i] / o;
  186|  5.13k|    }
  187|  2.56k|    return ret;
  188|  2.56k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.96k|  Self operator-(const Self &o) const {
  138|  1.96k|    Self ret;
  139|  5.88k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.92k, False: 1.96k]
  ------------------
  140|  3.92k|      ret[i] = (*this)[i] - o[i];
  141|  3.92k|    }
  142|  1.96k|    return ret;
  143|  1.96k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  41.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.59M|  VectorD() {
   41|  6.36M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.77M, False: 1.59M]
  ------------------
   42|  4.77M|      (*this)[i] = Scalar(0);
   43|  4.77M|    }
   44|  1.59M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|   115M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   115M|    DRACO_DCHECK_EQ(dimension, 2);
   54|   115M|    v_[0] = c0;
   55|   115M|    v_[1] = c1;
   56|   115M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  88.2M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   264M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 176M, False: 88.2M]
  ------------------
  104|   176M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 176M, False: 0]
  ------------------
  105|   176M|        v_[i] = Scalar(src_vector[i]);
  106|   176M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   176M|    }
  110|  88.2M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  44.1M|  VectorD() {
   41|   132M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 88.2M, False: 44.1M]
  ------------------
   42|  88.2M|      (*this)[i] = Scalar(0);
   43|  88.2M|    }
   44|  44.1M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  44.1M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   132M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 88.2M, False: 44.1M]
  ------------------
  104|  88.2M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 88.2M, False: 0]
  ------------------
  105|  88.2M|        v_[i] = Scalar(src_vector[i]);
  106|  88.2M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  88.2M|    }
  110|  44.1M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  68.2M|  VectorD(const Self &o) {
   89|   204M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 136M, False: 68.2M]
  ------------------
   90|   136M|      (*this)[i] = o[i];
   91|   136M|    }
   92|  68.2M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  35.2M|  VectorD() {
   41|   105M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 70.4M, False: 35.2M]
  ------------------
   42|  70.4M|      (*this)[i] = Scalar(0);
   43|  70.4M|    }
   44|  35.2M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   241M|  VectorD(const Self &o) {
   89|   966M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 724M, False: 241M]
  ------------------
   90|   724M|      (*this)[i] = o[i];
   91|   724M|    }
   92|   241M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|   724M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   115M|      : v_({{c0, c1, c2}}) {
   60|   115M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   115M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  79.5M|  inline int num_vertices() const {
   74|  79.5M|    return static_cast<int>(vertex_corners_.size());
   75|  79.5M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  12.9M|  inline int num_corners() const {
   77|  12.9M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  12.9M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  1.97M|  inline int num_faces() const {
   80|  1.97M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  1.97M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   325M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   325M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 325M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   325M|    return opposite_corners_[corner];
   88|   325M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   501M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   501M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 13.6M, False: 487M]
  ------------------
   91|  13.6M|      return corner;
   92|  13.6M|    }
   93|   487M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 427M, False: 60.2M]
  ------------------
   94|   501M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   465M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   465M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 4.87M, False: 460M]
  ------------------
   97|  4.87M|      return corner;
   98|  4.87M|    }
   99|   460M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 160M, False: 300M]
  ------------------
  100|   465M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   721M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   721M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 721M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   721M|    return ConfidentVertex(corner);
  106|   721M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   721M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   721M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   721M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   721M|    return corner_to_vertex_map_[corner];
  111|   721M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  51.1M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  51.1M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 51.1M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  51.1M|    return FaceIndex(corner.value() / 3);
  117|  51.1M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   948M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  53.0M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  53.0M|    return vertex_corners_[v];
  152|  53.0M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.53M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.53M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.53M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 40.1k, False: 1.49M]
  ------------------
  188|  40.1k|      return true;
  189|  40.1k|    }
  190|  1.49M|    return false;
  191|  1.53M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  94.8M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  94.8M|    return Previous(Opposite(Previous(corner)));
  202|  94.8M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  20.4M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  20.4M|    return Next(Opposite(Next(corner)));
  207|  20.4M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  4.51M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  4.51M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 4.51M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  4.51M|    return Opposite(Previous(corner_id));
  222|  4.51M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  6.01M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  6.01M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 6.01M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  6.01M|    return Opposite(Next(corner_id));
  228|  6.01M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   261M|                                CornerIndex opp_corner_id) {
  249|   261M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   261M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   261M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   313M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   313M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   313M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   313M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  75.1M|  VertexIndex AddNewVertex() {
  271|  75.1M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  75.1M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  75.1M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  75.1M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   168M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   168M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   168M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 168M, False: 0]
  ------------------
  295|   168M|      vertex_corners_[vert] = corner;
  296|   168M|    }
  297|   168M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|   903k|  void MakeVertexIsolated(VertexIndex vert) {
  329|   903k|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|   903k|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|   903k|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  3.49k|      : corner_table_(table),
  229|  3.49k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  3.49k|        corner_(start_corner_),
  231|  3.49k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.85M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  11.7k|  VertexCornersIterator &operator++() {
  268|  11.7k|    Next();
  269|  11.7k|    return *this;
  270|  11.7k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.28M|  void Next() {
  248|  3.28M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.26M, False: 25.6k]
  ------------------
  249|  3.26M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.26M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 22.7k, False: 3.23M]
  ------------------
  251|       |        // Open boundary reached.
  252|  22.7k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  22.7k|        left_traversal_ = false;
  254|  3.23M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 540k, False: 2.69M]
  ------------------
  255|       |        // End reached.
  256|   540k|        corner_ = kInvalidCornerIndex;
  257|   540k|      }
  258|  3.26M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  25.6k|      corner_ = corner_table_->SwingRight(corner_);
  262|  25.6k|    }
  263|  3.28M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.56M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  3.85M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  4.48M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.24M|  void Next() {
  248|  2.24M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.21M, False: 25.7k]
  ------------------
  249|  2.21M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.21M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.49M, False: 718k]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.49M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.49M|        left_traversal_ = false;
  254|  1.49M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 117k, False: 601k]
  ------------------
  255|       |        // End reached.
  256|   117k|        corner_ = kInvalidCornerIndex;
  257|   117k|      }
  258|  2.21M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  25.7k|      corner_ = corner_table_->SwingRight(corner_);
  262|  25.7k|    }
  263|  2.24M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  1.61M|      : corner_table_(table),
  236|  1.61M|        start_corner_(corner_id),
  237|  1.61M|        corner_(start_corner_),
  238|  1.61M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   559k|      : corner_table_(table),
  236|   559k|        start_corner_(corner_id),
  237|   559k|        corner_(start_corner_),
  238|   559k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  69.6M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  69.6M|    return is_edge_on_seam_[corner.value()];
   47|  69.6M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  31.5M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  31.5M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 31.5M]
  |  Branch (50:42): [True: 27.1M, False: 4.37M]
  ------------------
   51|  27.1M|      return kInvalidCornerIndex;
   52|  27.1M|    }
   53|  4.37M|    return corner_table_->Opposite(corner);
   54|  31.5M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  43.0M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  43.0M|    return corner_table_->Next(corner);
   58|  43.0M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  23.1M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  23.1M|    return corner_table_->Previous(corner);
   62|  23.1M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  6.24M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  6.24M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  6.24M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.63M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.63M|    return Opposite(Previous(corner));
   73|  3.63M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  4.07M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  4.07M|    return Opposite(Next(corner));
   76|  4.07M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  4.47M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  4.47M|    return Previous(Opposite(Previous(corner)));
   81|  4.47M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  14.1M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  14.1M|    return Next(Opposite(Next(corner)));
   86|  14.1M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  10.6k|  int num_vertices() const {
   89|  10.6k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  10.6k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  3.46k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.63k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   115M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   115M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   115M|    return ConfidentVertex(corner);
   97|   115M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   115M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   115M|    return corner_to_vertex_map_[corner.value()];
  100|   115M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.61M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.61M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.61M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.61M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.61M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.61M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.61M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.61M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 3.17M, False: 443k]
  ------------------
  128|  3.17M|      return true;
  129|  3.17M|    }
  130|   443k|    return false;
  131|  3.61M|  }

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

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

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

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

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

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

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

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

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

